Wall Collisions with manual position update
Hello, I am using a position tracking system, so the position of the character controller is updated manually like this:
transform.position = orientationOffset * pos + positionOffset;
transform.rotation = orientationOffset * ori;
This works well and needs to stay the same. Unfortunately, this means that I can't make colliders or OnTriggerEnter work (character walks through walls and no trigger is detected). Any recommendations to code in the collision checks manually to make this work?
I realize that I can Physics.overlapSphere or Physics.CheckSphere... but is there a better solution? I want the same exact functionality as using normal colliders. For example when the player walks into a wall, I want to detect that he touches the wall, but I also want the player to be able to walk along the wall while touching it. I can't determine a good way to do this with these two Physics checks.
Thanks!
Have you looked at the source code for the built-in character controller scripts? They handle exactly this problem and may have some insights for you.
wait... how do you access the source code? ive only been able to find this: http://docs.unity3d.com/ScriptReference/CharacterController.html and the component version of it.
Your answer
Follow this Question
Related Questions
OnTriggerEnter 1 Answer
Triggers Colliding With Triggers Not Working? [Solved] 1 Answer
walking on walls help 0 Answers
Scripting Portal 0 Answers
i keep going through walls please help 0 Answers