AttachObjectToObject messing up objects
#1

I'm trying to attach objects to the first object, but it seems to be messing it up.
So, when creating the objects, everything looks fine, but when attaching objects 2-6 to object 1, it won't work and I calculate the offsets accordingly, at least I think.

That's the code I create the objects with:
pawn Код:
for(new i=0; i<sizeof(NukeObject); i++)
{
    if(NukeObject[i][ObjID] == 0 || !IsValidObject(NukeObject[i][ObjID]))
    NukeObject[i][ObjID] = CreateObject(NukeObject[i][ModelID], NukeObject[i][PosX], NukeObject[i][PosY], NukeObject[i][PosZ], NukeObject[i][PosRX], NukeObject[i][PosRY], NukeObject[i][PosRZ]);
}
And that's the code I attach the objects in a different command:
pawn Код:
for(new i=1; i<sizeof(NukeObject); i++)
{
    if(i > 0)
    {
        new Float:tposx = NukeObject[i][PosX]-NukeObject[0][PosX], Float:tposy = NukeObject[i][PosY]-NukeObject[0][PosY], Float:tposz = NukeObject[i][PosZ]-NukeObject[0][PosZ];
    new Float:tposrx = NukeObject[i][PosRX]-NukeObject[0][PosRX], Float:tposry = NukeObject[i][PosRY]-NukeObject[0][PosRY], Float:tposrz = NukeObject[i][PosRZ]-NukeObject[0][PosRZ];
        AttachObjectToObject(NukeObject[i][ObjID], NukeObject[0][ObjID], tposx, tposy, tposz, tposrx, tposry, tposrz, 1);
    }
}
Reply


Messages In This Thread
AttachObjectToObject messing up objects - by arad55 - 28.07.2017, 22:17
Re: AttachObjectToObject messing up objects - by Kane - 28.07.2017, 23:19
Re: AttachObjectToObject messing up objects - by arad55 - 28.07.2017, 23:42
Re: AttachObjectToObject messing up objects - by arad55 - 29.07.2017, 00:59
Re: AttachObjectToObject messing up objects - by Pottus - 29.07.2017, 02:10
Re: AttachObjectToObject messing up objects - by arad55 - 29.07.2017, 02:16
Re: AttachObjectToObject messing up objects - by Pottus - 29.07.2017, 02:22

Forum Jump:


Users browsing this thread: 1 Guest(s)