- Home /
Teleporting INTO trigger or overlapsphere
When the character controller moves with transform.position (teleporting) and if there is a trigger or overlap sphere in the destination, it does not trigger. Is there anyway to solve this issue? Is there a work around? Im guessing that the current implementation doesn't work because these function relies on the physics side of stuff and transform.position isn't part of physics
Answer by SMT5015 · Jun 27, 2021 at 01:31 PM
Faced the same problem. Don't know the whole source but made a workarond. Dunno if it suits your case though.
I was making a teleport door which acted upon command. And it did detect player and spawned message that he is able to teleport, but ignored check for input until the player moved inside the trigger area the normal way (by physics). So I decided to manage player's presence via bool variable and moved the input check from OnTriggerStay2D into Update function. And it works fine.
Your answer
Follow this Question
Related Questions
Inaccurate collision detection (Bumps) 2 Answers
OnTriggerEnter2D not Working 0 Answers
Detecting when my character is not moving? 1 Answer
Manually check collision ? 1 Answer