- Home /
Problem with player prefab
I have a player gameobject which when collides with other powerup gameobjects gets special powers, but if convert the player gameobject into a prefab the powerup gameobject is just passing through the player gameobject.
can anyone help me?
Select Yourprefab And $$anonymous$$ake Sure It Has Collider Component $$anonymous$$ake Sure In Collider Property In Trigger Is Not Checked(False)
I have box collider 2d , it's still the same
Can You Post Picture Of Your Prefab Inspector?
Put a Debug.Log statement in you OnCollisionEnter2D (or OnTriggerEnter2D if using a trigger) just to verify if the event is firing or not. That would be my first step in troubleshooting it.
Answer by nithinkumar · Dec 07, 2019 at 09:25 PM
here are the screenshots
So It Seems Okay.. So For Identify a Coilliding 2 GameObject Should Have Colider Component And Atleast One Of Them Shoud Have Rigidbody Check Your PowerUp GameObject and Check Your Offset of Box Collider 2d $$anonymous$$ake Sure Colider Is around Your GameObject Perfectly..
If I don't convert the gameobject into a prefab it is working perfectly, once i convert it into prefab and instantiate it is not working.
Answer by Larry-Dietz · Jan 17, 2020 at 11:46 PM
The first thing that comes to mind right now, would be if you are checking for the object by name instead of tag, etc.. then the name of the prefab when instantiated, unless you change it after instantiation, will have clone added to the name.
If this is not the case, post your collision code so we can see what is going on.
-Larry