Yazir Posted February 16, 2016 Posted February 16, 2016 I wanted to ask if i could set 3d angles relatively to vehicle's position. I want to use this function. https://wiki.multitheftauto.com/wiki/Se ... rnVelocity How do i make it? What could i use?
Captain Cody Posted February 17, 2016 Posted February 17, 2016 https://wiki.multitheftauto.com/wiki/GetElementRotation Outputs the vehicles rotation, allowing you to set rotations relative to the vehicles rotation.
Yazir Posted February 17, 2016 Author Posted February 17, 2016 I know that function, but i'm not sure how to use it by desired needs. I don't want to set anglr, but force impulse of rotation.
Captain Cody Posted February 17, 2016 Posted February 17, 2016 After I read through it, Set Vehicle turn Velocity already has everything you need setVehicleTurnVelocity ( vehicle, -X Amount, -Y Amount, -Z Amount ) It is already relative to the vehicle.
Yazir Posted February 17, 2016 Author Posted February 17, 2016 When you set -x, then it always spin you north. It can push you sideways, front or back. It isn't relative to word.
Saml1er Posted February 17, 2016 Posted February 17, 2016 What are you trying achieve? I think you are looking for this: https://wiki.multitheftauto.com/wiki/FindRotation
Noki Posted February 17, 2016 Posted February 17, 2016 It's at times like these matrices are most useful.
Captain Cody Posted February 17, 2016 Posted February 17, 2016 When you set -x, then it always spin you north. It can push you sideways, front or back. It isn't relative to word. Oh you want to set the rotation relative to the word? Why didn't you state that in the first place. Get the rotation then subtract the rotation you want to set from the actual Z-rotation Spin = ("spinyouwant"-zrotation) Then use that value, it will rotate the vehicle relative to the world rotation with your set amount. -- Might be a bit more then that, I just woke up and noticed what you wanted, minds not 100% --
Yazir Posted February 17, 2016 Author Posted February 17, 2016 I meant world, not "word" . Anyway, I don't think you can get me. I'll try to start from scratch. When this: setVehicleTurnVelocity( getPedOccupiedVehicle( localPlayer ), vx + 1, vy,vz ) --*vx, vy, vz is current velocity of the car. is called, then if i'm heading north (up of the map), it will spin me forward, as expected, BUT if i'm heading for example east (right of the map, 90 degrees more than north), it will spin me counter-clockwise (to left). If i will be heading west, it will spin me clockwise (to right). I want, to make my vehicle spin forward, not sideways.
Captain Cody Posted February 18, 2016 Posted February 18, 2016 I meant to put world, just a typo, but get element rotation will work for what you need, make it so if the rotation is above a certain degree, use vy+1, if below vx+1. This may work, I have not done anything using the set rotation velocity function.
Yazir Posted February 18, 2016 Author Posted February 18, 2016 If you would use it, you would know what i mean. vehicle velocity + int, doesn't work as planned.
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