Jump to content

model collision


drarem
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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...