Hallo Leute,
ich habe mal ein Problem:
Ich möchte via Script einen Trigger laden, was (anscheinend) auch funktioniert, wenn ich Ihn dann allerdings von 0|0|0 zu meiner aktuellen Player.RootNode verschieben will, kommt er dort nicht an...
Bei erneuter Abfrage der Position liegt diese aber da, wo ich es haben will... Sehen kann ich trotzdem nix.
[expander][lua]
function Test:loadMap(name)
self.PositionX = 0;
self.PositionY = 0;
self.PositionZ = 0;
self.PressedTime = 0;
self.PositionAvailable = false;
self.TestI3D = loadI3DFile(Test.modDirectory .. "trigger.i3d");
link(g_currentMission.rootNode, self.TestI3D);
end;
[...]
function Test:update(dt)
if InputBinding.isPressed(InputBinding.Test_SetLocation) then
self.PressedTime = self.PressedTime + dt;
else
self.PressedTime = 0;
end;
if self.PressedTime >= 1500 then
self.PositionX, self.PositionY, self.PositionZ = getWorldTranslation(g_currentMission.player.rootNode);
self.PositionAvailable = true;
self.PressedTime = 0;
print(self.PositionX);
print(self.PositionY);
print(self.PositionZ);
print("---------------");
self.PositionA, self.PositionB, self.PositionC = getWorldTranslation(self.TestI3D);
print(self.PositionA);
print(self.PositionB);
print(self.PositionC);
setTranslation(self.TestI3D, self.PositionX, self.PositionY, self.PositionZ);
print("---------------");
self.PositionA, self.PositionB, self.PositionC = getWorldTranslation(self.TestI3D);
print(self.PositionA);
print(self.PositionB);
print(self.PositionC);
end;
end;[/lua][/expander]
Ich hoffe Ihr könnt mir helfen und schonmal vielen Dank an alle die Antworten
Gruß
Wagenheber