Yazir Posted February 16, 2016 Share 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? Link to comment
Captain Cody Posted February 17, 2016 Share Posted February 17, 2016 https://wiki.multitheftauto.com/wiki/GetElementRotation Outputs the vehicles rotation, allowing you to set rotations relative to the vehicles rotation. Link to comment
Yazir Posted February 17, 2016 Author Share 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. Link to comment
Captain Cody Posted February 17, 2016 Share 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. Link to comment
Yazir Posted February 17, 2016 Author Share 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. Link to comment
Saml1er Posted February 17, 2016 Share Posted February 17, 2016 What are you trying achieve? I think you are looking for this: https://wiki.multitheftauto.com/wiki/FindRotation Link to comment
Noki Posted February 17, 2016 Share Posted February 17, 2016 It's at times like these matrices are most useful. Link to comment
Captain Cody Posted February 17, 2016 Share 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% -- Link to comment
Yazir Posted February 17, 2016 Author Share 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. Link to comment
Captain Cody Posted February 18, 2016 Share 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. Link to comment
Yazir Posted February 18, 2016 Author Share Posted February 18, 2016 If you would use it, you would know what i mean. vehicle velocity + int, doesn't work as planned. Link to comment
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