Jump to content

Collision Triggers


randomkeyhits
 Share

Recommended Posts

I've created a disk and attached the standard CollisionTrigger.lua script.

 

While the physics type is prop or scene I can walk into it and the collision event is triggered.

 

The lua script above suggests that you can change the physics type to trigger and the event should trigger without any physics interactions in the scene. For me it doesn't and I can't see a reason why.

 

The only thing i can think of is perhaps the target is not Script:Collision but something else.

 

I've been going round and round with the documentation and forums so has anyone actually successfully done this and did they do something specific to make it work?

content over form, game play over all.

Link to comment
Share on other sites

Yes, I saw that thanks.

 

The interaction I used was the player walking onto the disk which once I switched the physics type to trigger I expected it to be the same except for the player would walk through the disk.

 

That and the rest of the documentation tells me it should work, I just can't figure out why not.

content over form, game play over all.

Link to comment
Share on other sites

I'm still not making progress with this

 

The player entity is type character.

 

I deleted and re-created the disk, set the collision type to scene and a shape of cylinder and used shape fit. I attached the CollisionTrigger script and it works ok. Walking into it with the player causes a collision to be triggered.

 

I then change the collision type on the disk to trigger. As expected I do not walk onto the disk but walk through it but now the ColliisionTrigger script is not invoked.

 

Switch the disk back to scene and the collision occurs again.

 

AFAIK this is correct, I just can't make it work.

content over form, game play over all.

Link to comment
Share on other sites

After a lot of experimenting finally made some progress on this. I'm not quite sure why the behaviour is as it is though.

 

I create a plane, place a player on it and a disk 1.5 metre diameter and 1 metre tall. I allow the top 25cm of the disk to appear through the ground. When the object is a scene the player can walk on the disk and a collision is registered. I change it to a trigger and I can walk through it but no collision is triggered.

 

I then raise the disk so that it sat on the plane rather than extruded through it and the trigger collision started working when I walk through the disk. So possibly some sort of clipping/culling thing based on the axis location?

 

I don't know if its intended or a bug or just the way things are but it means that I need to be quite careful in how I specify trigger zones

content over form, game play over all.

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