Jump to content

[HELP] Attaching object to vehicle, update rotation


Recommended Posts

Posted

So I want to create my own vehicle customization system instead of using addVehicleUpdate. The problem is using attachElements the object attached to the vehicle does not update the rotation when the vehicle turns... So, is there any way I can make it rotate while the vehicle rotates?

Thank you

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted

[quote name=..:D&G:..]

I think "attachElements" actually does that..

Which type of element are you attaching, Object?

I am trying to attach an object to the vehicle. I know I 've tried this function with a player and an NPC, and whenever I turned arround, the NPC was still facing north

I know this is happening with peds sometimes, but objects worked for me.

Around two months ago I was making script to attach boxes on truck and rotation was updating well.

Maybe try to fill rotation offset arguments.

Updating rotation manually on render would be fix, but not very clean one.

  • Moderators
Posted

[quote name=..:D&G:..]

I think "attachElements" actually does that..

Which type of element are you attaching, Object?

I am trying to attach an object to the vehicle. I know I 've tried this function with a player and an NPC, and whenever I turned arround, the NPC was still facing northAttach objects should be fine, unless there is something(a script) interfering.

In 2015 I released a train script.

mta_screen_2015_09_16_19_30_39.png

It attaches perfect with that function.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...