Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Unity AddForce Problem (not a bug problem, but a math problem)

$
0
0
Sorry for the lack of details in the title, the reason for that is that I don't know a short way of how to explain the problem I want to solve. Here's some context: I'm making a 3D platformer game where my player is a sphere that rolls and jumps around. I've already got in an orbital camera, the controls work fine and everything, but the method I use to move my player around is AddForce. Problem: This becomes a problem when I hold down both the W and the D key, it's applying the same speed unit to both the x and the z axis, which is actually causing my sphere to move faster diagonally rather than laterally. I've included a bit of a diagram at the bottom of what's happening versus what I'm trying to get to happen: For the purposes of simplicity, let's only add forces of 1 unit. Let the green arrow represent the force being applied. ![alt text][1] [1]: /storage/temp/109822-unity-addforce-problem.png

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>