Scooby Posted August 31, 2011 Posted August 31, 2011 Hi, I wonder if anyone can help me with this. I want to move a created vehicle forwards using setElementVelocity, The vehicle is stationary to start with. im not sure how to get the x and y needed for setElementVelocity, from the rotation of the vehicle to move it forwards. can anyone help me out with this equation? or am i missing an easier way to do this? [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
SDK Posted August 31, 2011 Posted August 31, 2011 This is one way speed = 0.5 _,_, rotz = getElementRotation(vehicle) rotz = math.rad(rotz) vel_x = speed * math.sin(rotz) * -1 vel_y = speed * math.cos(rotz) setElementVelocity(vehicle, vel_x, vel_y, 0) Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
Scooby Posted August 31, 2011 Author Posted August 31, 2011 nice one man, that looks like it has what i need, thanks alot [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now