|
I am needing a code that when you collide with an invisable collide i have placed in the doors. I want it so that each door of my building has a invisable collider in it and depending on wich u collide with you go inside to the other side of that door. All my inside and out are in one scene.
(comments are locked)
|
|
It sounds to me as though you want to have a collider defined as a trigger and when the trigger throws an event, you detect that event and change the position of the character that caused the trigger to be a new position corresponding to "inside door". The core concepts of this answer are:
(comments are locked)
|
|
ok what you can do is set an emptyGameObject in each of the sides of the door(where the player will "teleport"once the collider is activated)..and add this script to the empty game objects. second add another 2 empty game objects and place them a little appart from the other 1s so its like if u have 2 emtygameobjects on each side .....add this script to 1 emty on each side ...and a collision box ..set the collision box to "trigger"...and fill in the "destination" variable by draging the oposite empty into there ...so emty is 2 collided and the other to teleport from the opposite side.....
(comments are locked)
|
