Jump to content

setAttachedObject position ?


Recommended Posts

Hi, there is an object which is attached to a player

 

        cache['objectAttach'][client] = createObject(id, myX, myY, myZ)
        attachElements(cache['objectAttach'][client], client, 0, 0, 0)

 

My question is, how can i change the Z cord if it's attached ?

i was trying like 

        local x, y, z = getElementPosition(client)
        newZ = z - 0.05
        setElementPosition(cache['objectAttach'][client], x, y, newZ)

but i don't think that i can  change the attached object pos;

any help thanks

Link to comment
  • Moderators

The map editor already has this feature.

 

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight

Getting the ground/floor position.

 

https://wiki.multitheftauto.com/wiki/GetElementBoundingBox

Getting the object size.

 

 

 

The map editor already has this feature.

 

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight

Getting the ground/floor position.

 

https://wiki.multitheftauto.com/wiki/GetElementBoundingBox

Getting the object size.

 

 

 

  • Thanks 1
Link to comment

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...