- Home /
The question is answered, right answer was accepted
Noob Question -- Programming 2d platformer
So I want my character to go through a door and come out of another door. Now the script that I wrote works fine for one pair of doors. When I copy (duplicate) my set of doors, my character still goes to the first 2 doors. Even though the doors that I dragged into the public 'doorone' and 'doortwo' field are different. Why is this not working?
@levoTNTO So I have 4 doors in total. Door 1 is attached with door 2 and door 3 is attached with door 4. If I stand on door 4, I want it to go to door 3. But instead its going to door 1. All the doors have a collider and my player has a collider and a rigidbody. I'm stuck with this problem for a long time now but I think my code is just wrong in some way
Answer by Xitech_ · Aug 18, 2016 at 10:03 AM
Does the door have a collider attached? Without a collider your player cant have physics to that door. And I asssume the player has both a collider AND rigidbody? And are you sure the code is on another object again? And are you sure the correct door is attached?