drarem Posted April 28, 2016 Share Posted April 28, 2016 Hi, I have a basic model, the inside of a box like an elevator you can walk into. I find I have to keep pushing against the wall of the box to register a collision. How or what would I do to increase the range of the collision so I don't have to be pushing against it? In other words, if I walk into the box the collision is registering. Thanks. Quote Link to comment Share on other sites More sharing options...
thehankinator Posted April 28, 2016 Share Posted April 28, 2016 I don't think it's possible to do it like you want to. I would create a trigger zone to check if the player is within the area in question. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 28, 2016 Share Posted April 28, 2016 Sounds like a trigger is needed: http://www.leadwerks.com/werkspace/page/tutorials/_/doors-r24 Quote 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...
drarem Posted April 28, 2016 Author Share Posted April 28, 2016 So I must use the flowgraph editor to handle a trigger? The trigger is a child of the box, but it doesn't fire off when i enter the trigger zone as a collision(). function Script:Collision(entity, position, normal, speed) if (entity:GetKeyValue("type") == "player") then System:Print("In the trigger zone") trigzone = true else System:Print("Outside the trigger zone") trigzone = false end end Quote Link to comment Share on other sites More sharing options...
drarem Posted April 28, 2016 Author Share Posted April 28, 2016 On my own function, using the flowgraph i see a plain line, where when i connect to the Collision() script I see the 'marching' dots along the line, if that makes sense. It gets triggered in the Collision() function of the elevator script, even though I change it to calloutputs("Collidex").. somehow it still triggers in the Collision() function. Trigger script: function Script:Collision(entity, position, normal, speed) if self.enabled then self.component:CallOutputs("Collision") end end elevator script: function Script:Collidex()--in System:Print("Triggered here.!.") end function Script:Collision(entity, position, normal, speed)--in if (self.window==nil) then self:Start() end System:Print("Triggered in collision function..!.") if self.window:KeyDown(Key.E) then self.entity:Move(0, 0, -0.001) entity:SetGravityMode(false) else entity:SetGravityMode(true) end end Quote Link to comment Share on other sites More sharing options...
drarem Posted April 28, 2016 Author Share Posted April 28, 2016 Even then it only triggers if i'm moving within the trigger zone, if I stand still there is no continual triggering event. What am I missing? Thanks. Quote Link to comment Share on other sites More sharing options...
thehankinator Posted April 29, 2016 Share Posted April 29, 2016 What are you trying to accomplish? Quote Link to comment Share on other sites More sharing options...
drarem Posted April 29, 2016 Author Share Posted April 29, 2016 Be able to activate an object without having to touch it directly. Like at a distance. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 29, 2016 Share Posted April 29, 2016 Did you set the collision type of the object to "Trigger"? Quote 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...
drarem Posted April 29, 2016 Author Share Posted April 29, 2016 Yes, it's set as Rigid Body / Trigger under the Physics tab, with script of CollisionTrigger.lua in the script tab. I set up the flowgraph, then i right click, save as prefab. Then I deleted the object on the editor and it's loaded at runtime. I brought it back in from the prefab folder, nothing is showing up in the flowgraph editor when i select the objects. Quote Link to comment Share on other sites More sharing options...
drarem Posted April 29, 2016 Author Share Posted April 29, 2016 The main thing is, my trigger isn't triggering but it's a child of the main object. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 29, 2016 Share Posted April 29, 2016 Post your map or a simple example so we can try it. 1 Quote 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...
drarem Posted May 2, 2016 Author Share Posted May 2, 2016 I used a different simple model as a trigger, it's working now. 1 Quote 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.