How to get coordinates in center of an object?
#1

Hi guys, How can i to get coordinates in center of an object? (The object is 3004 [pool cue])
Reply
#2

GetObjectPos ?
Reply
#3

Unfortunately running GetObjectPos on that specific object ID will return it's cue tip position, instead of the "center" position, so you will have to get the center pos by trial and error, AFAIK that cue stick is about a meter and a half long, so just add ±1,543 divided by 2* to either end of the stick to get position (relatively) in the middle of the pool cue.

* Got that number by measuring, it's not that "precise".

Edit: Use what Mauzen said, works precisely! You have to use trig to get the offsets right, though.
Reply
#4

You could take a look at this: https://sampforum.blast.hk/showthread.php?tid=407909
It should give you the correct center offset, you just need to consider rotation.
Reply
#5

Use this.
Reply
#6

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
You could take a look at this: https://sampforum.blast.hk/showthread.php?tid=407909
It should give you the correct center offset, you just need to consider rotation.
Thanks, but now when i attach the object with another object (using the AttachObjectToObject) and i try to get the coordinates, the coordinates are all at 0.0.. how can I get the coordinates of an object attached?
Reply
#7

Problem solved! Thanks to all!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)