beo6 Posted March 8, 2013 Share Posted March 8, 2013 Hello everyone. I am Scripting a bit to get used to Lua. Now i have a problem that the Game crashes as soon as i use this Script: Script.target = nil--Entity "Target" --[[ function Script:Start() end ]]-- function Script:UpdateWorld() --Exit the function if the target entity doesn't exist if self.target==nil then return end self.centerpoint = self.target:GetPosition(true) end But when i use GetPosition inside Script:Start() it works as it should. But i need the position on every Update. Can someone help me? Thanks in advance Link to comment Share on other sites More sharing options...
Josh Posted March 8, 2013 Share Posted March 8, 2013 Set a breakpoint on the first line of UpdateWorld() and look at the entity. If the program crashes before the breakpoint is hit, it means the entity was deleted somewhere else: http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/script-editor-r6 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
beo6 Posted March 8, 2013 Author Share Posted March 8, 2013 Hello. I have set a Breakpoint and it crashed too. But i don´t know where the entity should be deleted. It is a really basic Map with nothing else. Here is a even smaller Map (see attachment) with the same behavior if you like to have a look: The debugger also says nothing. it just crashes. test.zip Link to comment Share on other sites More sharing options...
Admin Posted June 26, 2013 Share Posted June 26, 2013 Need a complete example to run please. Link to comment Share on other sites More sharing options...
Recommended Posts