AttachObjectToObject
#1

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?
Reply
#2

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

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

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.
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)