Rick Posted March 16, 2013 Share Posted March 16, 2013 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) Quote Link to comment Share on other sites More sharing options...
tjheldna Posted March 16, 2013 Share Posted March 16, 2013 Not too sure if this has anything to do with it as I mainly use c++ but I noticed there is a comment along the calloutputs function --in, could that have something to do with it? don't know. function Script:Activate()--in end Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 16, 2013 Share Posted March 16, 2013 Do simple perhaps , try without trigger and don't use Calloutputs, just call a function of the script. Perhaps it will work better ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted March 16, 2013 Author Share Posted March 16, 2013 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. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 16, 2013 Share Posted March 16, 2013 How collision does works in "Dakrness" game ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
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.