Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: koala on April 30, 2020, 06:21:10 AM

Title: set radom vector direction and add force
Post by: koala on April 30, 2020, 06:21:10 AM
Hello, I am trying to make a sphere move in a random direction.
In the first state I do the following:
- I create two random float variables. one for the x direction and one for the y direction, with values between -1 and 1
- I create another float variable with the speed at 200,
- I create another variable vector 3 called ball vector that takes the random values of x and y

In the second state I do the following:
- I add the action add force
- to the parameter vector I give the value ball vector
- to the parameter x I give the value of the speed
- to the parameter and I give the value of the speed

doing this, the sphere always moves in the same direction and not randomly.

what am I doing wrong?
can you help me please
thank you very much to all!
Title: Re: set radom vector direction and add force
Post by: ch1ky3n on May 01, 2020, 09:32:23 AM
instead of randomizing it at first, try to manually assign a value on it and check if it could change the direction

assign bigger value and see if it is actually moving in a different direction.