Jump to content
Taylor1984

Get position on top of object

Recommended Posts

Hi

 

Say I want to check if a unit is standing in eg a corner of a concrete slab object, how do I get the position of the corner regardless of what direction the concrete slab is facing? I guess it's like getPos but with some kind of modeltoworld thing? I mean the following wouldn't work obviously unless the slab was always facing the same direction:

_pos = [(getPos _slab select 0)+2,(getPos _slab select 1)+2,(getPos _slab select 2)+1]

 

Thanks

Share this post


Link to post
Share on other sites

worldToModel maybe, you will get relative coordinates in model space, which you can then compare with boundingBox of the slab, or some preset coordinates you define yourself

Share this post


Link to post
Share on other sites
On 3/18/2019 at 11:02 PM, Taylor1984 said:

Hi

 

Say I want to check if a unit is standing in eg a corner of a concrete slab object, how do I get the position of the corner regardless of what direction the concrete slab is facing? I guess it's like getPos but with some kind of modeltoworld thing? I mean the following wouldn't work obviously unless the slab was always facing the same direction:


_pos = [(getPos _slab select 0)+2,(getPos _slab select 1)+2,(getPos _slab select 2)+1]

 

Thanks

 

if [2, 2, 1] is ur relative position from slabs center then:

 

_world_pos_corner = _slab modelToWorld [2,2,1];

look at wiki:

modelToWorld

 

 

______________________

2 hours ago, DeathF0X said:

@DeathF0X what should this help with?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×