Jump to content

setAttachedObject position ?


Recommended Posts

Posted

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

Posted

Nice one thanks. Another question ,  is there any function, or something to check that is the object is still visible ? I mean when i change the Z pos (to down - ) of the object, i want to stop to the object go under the world

  • Moderators
Posted

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

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