Lerp ignores collision and allows player to move through a wall.
My issue
I have a dilemma that I am stuck on for a couple days now. I know that Lerps and translates ignore physics and thus I cannot use them to move rigidbodies, if I want a "player" object to collide with walls. However, I cannot seem to find a way to limit the distance of a AddForce to a whole number position.
What I am trying to achieve
I have a script that detects swipes in the 4 cardinal directions within the update function. I would like on a swipe event, to move the player rigidbody one whole unit in the swiped direction. i.e. position (0, 0, 0) to (0, 0, 1) for a swipe up. So if there is any kind of movement specifically that uses force and limits the distance it goes to a specific point...that would be the perfect solution to my problem...I just know it won't be that easy. haha
Thank you very much in advance!
Hey there, This has the makings of a fairly good question, but it's very difficult to understand your situation. There are so many ways to achieve similar results, so it's easy to take important information for granted when talking to others. Including a screenshot is always a smart move to help us connect the dots. Describe your scene, tell us all relevant objects and logic involved, showing code where applicable.
Your answer
![](https://koobas.hobune.stream/wayback/20220612101844im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Got unwanted motion blur on fast moving object (Only iOS) 0 Answers
Arrow mechanic like soccer star 0 Answers
I don't want the arms to turn with the ball at my game 0 Answers
Not changing WASD controls when character turns 0 Answers
Rigidbody sticks to wall 0 Answers