Jump to content
Sign in to follow this  
DeadWeight85

CreateVehicle Direction

Recommended Posts

I am working a skeet machine script, just for fun but I am having some trouble with setting the direction of the skeet when they launch out of the machine. As it stands right now they will launch out in only one direction. I am looking to have them launch in a random direction to the front of the spawn point. As it stand right now I have this:

_skeet = "Skeet_Clay_F" createVehicle getPos SM;
_vel = velocity _skeet;
_skeet setpos (SM modeltoworld [0, -0.6]);
_skeetVel = _skeet setvelocity [-9 * sin getdir SM, -9 * cos getdir SM, 10 + random 2];

I was thinking of the setDir, but I was unsure on how to set it so that would be random. Any thoughts on how to get started?

Share this post


Link to post
Share on other sites

to change the direction you will need to modify the setVelocity component

try this

_skeet = "Skeet_Clay_F" createVehicle getPos SM;
_skeet setPos (SM modeltoworld [0, -0.6]);
_skeet setvelocity [-9 * sin (random 360), -9 * cos (random 360), 10 + random 2];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×