Jump to content

game crash volume trigger


Rick
 Share

Recommended Posts

So I'm trying to create a volume trigger. I have the following lua file:

 

 

Script.triggerEntity=nil--entity "Trigger Entity"


function Script:Collision(entity, position, normal, speed)
if self.triggerEntity ~= nil then
if self.triggerEntity == entity then
self.component:CallOutputs("OnCollide")
end
else
self.component:CallOutputs("OnCollide")
end
end

function Script:OnCollide()
end

 

 

I make a box csg. I give it the invisible material. For physics I have it as Rigid Body, shape is box, clicked fit shape, set collision type to Trigger, and unchecked nav obstacle.

 

For the script I dragged the Barbarian entity as the triggerEntity. When the Barbarian collides the game crashes. The Collision() function does not get hit (I have a breakpoint in there). Any ideas why it would crash? The editor doesn't crash just the game.

 

The only thing in the console reads: Error: Unknown client disconnected (in red)

Link to comment
Share on other sites

The thing is it doesn't even hit the Script:Collision() function. I put a break point right away in the function and it never gets there, so it never has the chance to call any outputs or do anything. The fact that it does exit on collide almost points to maybe the Collision() function isn't defined correctly or something, but I copied from the doc (not that it can't be wrong in the docs).

 

 

The docs talk about a collision trigger script that should come with the engine (http://www.leadwerks.com/werkspace/page/documentation/_/script-reference/collisiontrigger-r702). Does anyone have this? I don't seem to have it, but I could have deleted it I guess.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...