tonievalue Posted April 22, 2017 Posted April 22, 2017 Hello, i'm looking for method to attach element to fork in forklift (http://imgur.com/DDbEdcZ.png), any suggestions?
NeXuS™ Posted April 22, 2017 Posted April 22, 2017 If you use attachElements, and offsets, the attached elements will move as the fork moves up or down.
Captain Cody Posted April 22, 2017 Posted April 22, 2017 You need to use getVehicleComponentPosition.
tonievalue Posted April 22, 2017 Author Posted April 22, 2017 1 hour ago, CodyJ(L) said: You need to use getVehicleComponentPosition. Yes, but getVehicleComponents return empty table on forklift, so propably this vehicle don't have components 1 hour ago, NeXuS™ said: If you use attachElements, and offsets, the attached elements will move as the fork moves up or down. I don't have event to fork moves
NeXuS™ Posted April 22, 2017 Posted April 22, 2017 Just attach an element to the vehicle, and use the fork by your keyboard. The attached object will move with the fork. Yes, I tested it. local forkVeh = createVeh(getVehicleIDFromName("Forklift"), 0, 0, 10) local testObject = createObject(1337, 0, 0, 0) attachElements(testObject, forkVeh) And as you use your bind to move the fork up, the testObject will also move with it.
Captain Cody Posted April 22, 2017 Posted April 22, 2017 I'll be damned it does; maybe the lift is represented as the physical body of the fork lift (How they pulled off collisions from it).
NeXuS™ Posted April 22, 2017 Posted April 22, 2017 Feel free to test it @CodyJ(L), works as it is supposed to work.
MTA Team Lpsd Posted April 22, 2017 MTA Team Posted April 22, 2017 17 minutes ago, NeXuS™ said: Feel free to test it @CodyJ(L), works as it is supposed to work. You might wanna re-read what he said,
NeXuS™ Posted April 22, 2017 Posted April 22, 2017 Yep @LopSided_, re-read it already, and found that I misread his comment. 1 1
tonievalue Posted April 23, 2017 Author Posted April 23, 2017 12 hours ago, NeXuS™ said: Just attach an element to the vehicle, and use the fork by your keyboard. The attached object will move with the fork. Yes, I tested it. local forkVeh = createVeh(getVehicleIDFromName("Forklift"), 0, 0, 10) local testObject = createObject(1337, 0, 0, 0) attachElements(testObject, forkVeh) And as you use your bind to move the fork up, the testObject will also move with it. Okey, but any player can change bind in MTA menu (https://gyazo.com/61d6850aa4dc5e99a861e74df057b001), and i can't read player's bind's
NeXuS™ Posted April 23, 2017 Posted April 23, 2017 (edited) Mate, you dont have to control the movements of the fork, MTA does it itself. Just use ANY keybind to move the fork, and the attached element will move without any problem or script. Edited April 23, 2017 by NeXuS™ 1
tonievalue Posted April 23, 2017 Author Posted April 23, 2017 1 minute ago, NeXuS™ said: Mate, you dont have to control the movements of the fork, MTA does it itself. Just use ANY keybind to move the fork, and the attached element will move without any problem or script. Okay, thanks mate
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