SA-MP Forums Archive
AttachObjectToObject - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: AttachObjectToObject (/showthread.php?tid=303223)



AttachObjectToObject - rbN. - 12.12.2011

Okay so, in 0.3d there's AttachObjectToObject. The wiki of SA-MP says this;
Код:
The distance between the main object and the object in the X/Y/Z direction.
The X/Y/Z rotation between the object and the main object.
But, how can you calculate these?


Re: AttachObjectToObject - §с†¶e®РµРe - 12.12.2011

https://sampwiki.blast.hk/wiki/AttachObjectToObject
This will help you!!


Re: AttachObjectToObject - rbN. - 12.12.2011

Quote:
Originally Posted by §с†¶e®РµРe
Посмотреть сообщение
I saw it, I just need to know how to calculate these; OffsetX, OffsetY, OffsetZ, RotX, RotY, RotZ


Re: AttachObjectToObject - Babul - 12.12.2011

when you create 2 objects, you can estimate the offset for object 2 by aligning it to object 1. object 1 should be set to no rotation, so you can manually "stick" object 2 to it. those position/rotation offsets can be used for the AttachObjectToObject() function.


Re: AttachObjectToObject - rbN. - 12.12.2011

Quote:
Originally Posted by Babul
Посмотреть сообщение
object 1 should be set to no rotation
Hey, thanks! I forgot that haha.. +rep


Re : AttachObjectToObject - Baboon - 12.12.2011

babul, that don't even has to be like that.
Just get every object info (rot / pos) and minus that from the object which you are going to attach to.


Re: AttachObjectToObject - Babul - 12.12.2011

oops, i forgot to properly mention that - the offset from 10 to 11 is 1. and from 0 to 1 its 1, too, thats why i mentioned "offset" - its 1, however you estimate it
oh maybe its worth mentioning that an object 3 could be attached to object 2, this will need 1 "cycle" more, since object 2 needs to be attached to object 1 first, in order to let object 3 attach to object 2 correctly. for like 100 objects, you can notice like 2-3 seconds pased until the map is fully aligned...