remove collision with ground floor,Remove collision with floor
Hey,
I am currently working on my first 3D phone game. I've got a player (a sphere in this case) who should be colliding with the red plane on the front to trigger the UI event. However if I hit "play" the event is instantly triggered and I think it's because of the floor.
I've changed the floor from a plane to a cube, gave it a tag and a layer but nothing seems to be working.
Or is there another way to trigger the event as soon as the player hits the red plane?
The collisionTrigger FSM should only start when the player hits the red plane but instead it's starting as soon as I hit play.
Thanks so much!
Images:
floor: https://gyazo.com/6ce04518be4b08a8cd0ca484dfad3761
player: https://gyazo.com/9bebe7836e3c132601cf646d89bcf340
trigger: https://gyazo.com/9bcc6d9154a2359b2a5dc5d8c5ffe11c https://gyazo.com/217fbd8b80c3d24b21960b86584aa084
Answer by _DS_1 · Dec 02, 2020 at 09:54 AM
You should check in the trigger enter the gameObject tag or the gameObject. I never used Playmaker, so you have to "translate" this code, sorry
-Edit: https://hutonggames.fogbugz.com/default.asp?W37 This might help you.
In code is something like:
public GameObject redPlane; //Method 1
public string tagRedPlane; //Methdo 2
void OnTriggerEnter(Collider c)
{
//Method 1
if (c.gameObject == redPlane)
{
//Button code here
}
//Method 2
if(c.gameObject.CompareTag(tagRedPlane))
{
//Button code here;
}
}
Your answer
Follow this Question
Related Questions
PlayMaker Creating an interactive object 0 Answers
Projecting hole in Unity 5 0 Answers
I want to know which key to stop the app 0 Answers
CAN i BULID FOR PSP 0 Answers
unity 5 car tutorial 3D 1 Answer