Collison not working

My Collison is not working on one of my objects.

You will spawn in a hallway, go towards the black and you will see a mine, when you step on the mine you will be teleported back. Then when walk forward again the missle will come. But I have the code so that when the missle hits you it teleports you to the start. It doesn’t do that though, In the code it doesn’t even detect a collision. The code used are the last 3 code groups. Thanks!
Share Link: CoSpaces Edu :: Test-Maze-4

Hi @Matthew_Willett this is actually the same problem as one in an earlier post;

Only 1 collide with event is allowed per object (adding another will overwrite it); There are 2 ways to go about it:

  1. Instead of checking to see if the camera hits the object, do the opposite and check if the object hits the camera instead; Same thing but now each item has 1 event on it, instead of the camera having 2 (meaning 1 won’t work). This is the simpelest method and by far the best practice to use.
  2. Way more convoluted but sometimes usefull is adding a When camera collides with “Another item”, then using an “if statement” to check if that item is one of the items you want. The problem is the computer will have to check that for each item the camera collides with; So generally not the best approach, but can be usefull in certain cases.

I’ve just switched the position of the event inputs here;

1 Like

Thanks for helping! It works now!

2 Likes

It sounds like your collision issue could be due to a couple of common causes in these kinds of projects:

Object settings – Make sure collision is enabled for the missile object in its properties. If it’s set to “No Collision” or if it’s part of a group without collision enabled, the event won’t trigger.

Physics layers/groups – If you’re using layers or collision groups, ensure the missile and player are in groups that can interact. Sometimes one is set to ignore the other.

Object movement method – If the missile is being moved via a “set position” or teleport every frame instead of physics forces, some engines don’t register collisions because the object is skipping past the collider (“tunneling”). Using physics movement or enabling continuous collision detection can fix this.

Trigger type – Check whether the collision event is expecting a “touch” vs “overlap” vs “enter” event. The wrong type means the script won’t fire.

Script scope – If your “last 3 code groups” are attached to the wrong object (missile instead of player, or vice versa), the collision function won’t run for the object you expect.

A good test is to temporarily add a debug log or visual effect inside the collision function so you can confirm if it’s running at all. If it still doesn’t trigger, it’s almost certainly a settings or movement method issue rather than the teleport code itself.

If you want, I can rewrite your collision detection code so it’s guaranteed to trigger in your setup. Can you share those last 3 code groups?

By OzaIntel