Jump to content

--Entity gets "has stopped working" error


Recommended Posts

Does 'box 5' have mass or a script attached to it? If not, then it has been collapsed with the rest of the scriptless, massless CSG in the scene - essentially making 'box 5' no longer a viable standalone entity.

 

If you are wanting to use a massless, scriptless CSG entity for setting the position for something based on a key hit, then i would suggest obtaining the position of that entity in the Start function to be used later in UpdateWorld() - as it appears the Start functions are called prior to the CSG collapsing.

 

Script.point = nil --Entity "Point"

 

function Script:Start()

self.pos = self.point:GetPosition(true)

end

 

function Script:UpdateWorld()

if window:KeyHit(Key.A) then

self.entity:SetVelocity(0,0,0)

self.entity:SetPosition(self.pos,true)

end

end

 

Or just use a pivot or attach an empty script to the CSG...

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...