- Home /
How to make my Character run through walls with the use of the Character Controller component
Hi, Im currently making a FPS game with Parkour mechanics. I'm currently using the character controller component and it's currently working well (for the most part). I'm currently thinking of a wall run mechanic and been looking at youtube and other sources for someone to give me a hint on what to do on how to create a way to colliding to walls and creating either a raycast to detect the length of the wall then moving to that direction. I just need a hint on how to do it efficiently on code since I've been experimenting but to no avail. I understand that rigidbody may be the best way for this but I find the character controller to be more flexible since the physics that I made in this Character Controller has the right feel that I like. I just want someone to point me at the right direction not a full snippet of code or anything just someone to put me at the right direct.
Any advice and help would really be appreciated. :)
Answer by Arpi01 · Jul 25, 2019 at 11:28 PM
What i did once was to detect on collision the angle of the object i was colliding with, to know if it is a wall, then if it is a wall, i would save it in a variable until leaving collision, and if while the variable wasn't null the player would click the corresponding button (in my case was shift), i would make the player not be affected by gravity and apply a force, then for a direction you could calculate it, but i was too lazy so what i did is put 2 empty childs one on each edge, and i would detect the direction and make the player move on the direction to the corresponding child
Your answer
Follow this Question
Related Questions
Physic Based FPS Movement,Fps Movement Physic Based 0 Answers
Every time i test my game,my character flies upward infinitely 1 Answer
Trace 3D Basketball Shot 1 Answer
How to move while jumping? 1 Answer
Fps Movement Velocity Decrease 0 Answers