Page 1 of 1

Posted in Interface section, but maybe can get answer here

Posted: Wed Jun 27, 2012 9:09 pm
by bill2reg
Trying to set up a motion somewhat like a reel on a slot machine. Using the spacebar to initiate a spin is OK, as long as I hold the spacebar down it spins. But I want to hit the spacebar once and then have the wheel spin a random number of times and stop on a face of the cylinder. I don't see how to set this up, so if anyone has a suggestion, I'd appreciate the help. Thanks.
Reply with quote

Re: Posted in Interface section, but maybe can get answer he

Posted: Mon Jul 02, 2012 7:45 am
by RoboticGolem
bill2reg wrote:Trying to set up a motion somewhat like a reel on a slot machine. Using the spacebar to initiate a spin is OK, as long as I hold the spacebar down it spins. But I want to hit the spacebar once and then have the wheel spin a random number of times and stop on a face of the cylinder. I don't see how to set this up, so if anyone has a suggestion, I'd appreciate the help. Thanks.
Reply with quote
Seeing as you have no reply, I'm going to do my best to give you an idea. I've never used the game engine (I'm assuming that's what your using)and that your writing a python script to stop your wheel?

if so, you could easily append a quick function to make your wheel stop after a random number of turns.

import random
turnstop=random.randint(x,y)

Where x is the minimum number of turns, and y is the maximum. Then just plug in the turnstop to your controller(?)

Hope this helps =/

Posted: Mon Jul 02, 2012 2:38 pm
by bill2reg
I am using the game engine. I am not at all familiar with Python, so I have no idea what that script is or how to use it. I had assumed that somehow the "random" actuator in the BGE might be used along with some value input to a sensor....such as =>, <= etc, but I couldn't see exactly how that might work. But thanks for the suggestion.

Posted: Mon Jul 02, 2012 5:52 pm
by stiv
Questions about *using* blender are best asked at the user forums on blenderartists.org .