Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Avascar on December 16, 2012, 07:56:17 AM
-
Hey everybody, so apperently I've been having issues with collision detections. I created, let's say, a spike. If the player touches the spike then the player respawns. So I added a rigidbody to the spike, and one too for the player. They work pretty well, it's just that I'm having great difficulty with collision detection in the script. Any help? I don't want to use triggers on this by the way.
EDIT: @The picture below: The first state (Trigger) doesn't have any events, The second state (Respawn) does, but it's unrelated to the collision problem I believe.
-
Collisions in unity depend on various characteristics.
Maybe you already saw it:
http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
scroll to the end of the page there“s a handy chart there. Recheck your rig against it.
-
Alright it works fine, however it kills me whenever it touches the floor. How do I make it so it only triggers an event if it collides with a specific game object?
EDIT: So I've been experimenting, and I made another game object (that kills you with Collision Enter) and made it move in the air (so it doesn't touch anything). However, I've been having another issue, the collision doesn't happen unless I somehow move "inside it", not touching it.
-
Hi,
When you want more options for detection collisions, you should use the "Collision Event" action:
https://hutonggames.fogbugz.com/default.asp?W30 (https://hutonggames.fogbugz.com/default.asp?W30)
this action allows you to filter by tag.
the other option, is to check the hit gameObject manually, either by checking its name, tag, layer or else. you can use the action "Get Collision info" to do that.
https://hutonggames.fogbugz.com/default.asp?W369 (https://hutonggames.fogbugz.com/default.asp?W369)
one last option, is Unity based: the physics matix, where you can stipulate how layers can collide or not with each others, This is very powerful as well, as you can simply void out any physics gameObject you don't want for some collisions. not this is an advanced feature, so make sure you fully understand what this means:
http://docs.unity3d.com/Documentation/Components/class-PhysicsManager.html (http://docs.unity3d.com/Documentation/Components/class-PhysicsManager.html)
bye,
Jean