Jump to content
Sign in to follow this  
K120

Set vehicle spawn with full speed

Recommended Posts

Hey,i couldn't find anything helpful about this.

I need to set some vehicles to go full speed instantly as they spawn,is there something i could put in vehicles init field?

Share this post


Link to post
Share on other sites

I was playing around with this yesterday.

setVelocity is the starting point but I think that will just fling the vehicle west or east I cant remember. [20=east/west?, 0=North, 0=vertical]

You will need to get it's heading first.

I think found the solution this morning but have not been able to try it yet as I'm at work. Give either of these a try.

Change 100 to slow it down.

_v setpos [(getpos _v) select 0, (getpos _v) select 1, 100] _v setvelocity [100 * (sin (getdir _v)), 100 * (cos (getdir _v)), 0] 

This one is direct from the wiki. http://community.bistudio.com/wiki/setVelocity

_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10; comment "Added speed";
_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+
(cos _dir*_speed),(_vel select 2)];

Edited by Magicpanda

Share this post


Link to post
Share on other sites

Ok so I worked this out. This will fire truckname 100 meters per second in the direction it is facing which is obviously fucking madness. :D

truckname setvelocity [100 * (sin (getdir truckname )), 100 * (cos (getdir truckname )), 0]  

Mission Example

Edited by Magicpanda

Share this post


Link to post
Share on other sites

Did a bit more testing and this only seems to work for Cars like the Hunter. Armoured Vehicles will just hit the brakes asap.

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  

×