SA-MP Forums Archive
Is there a way to parent objects? - 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: Is there a way to parent objects? (/showthread.php?tid=573318)



Is there a way to parent objects? - Orma - 06.05.2015

For instance, if I mapped in an aircraft carrier with 100 objects on it in various different locations, could I parent said objects to the ship so that they rotate around its axis and move in the directions it moves it? Seems like it would be easier to do something like this than to manually move every object.


Re: Is there a way to parent objects? - Vince - 06.05.2015

Yes, see AttachObjectToObject. However, it is worth noting that you need to use offsets here, not absolute coordinates.