Hey all,
I’m writing a vehicle game for a school project in which the vehicle can climb the walls (the vehicle is a giant wheel).
I’ve made some headway on the scripting but I have two questions, hopefully someone can answer them.
#1
__
Is there anyway to change the direction that gravity pull down on, as far as Rigidbodys are concerned. I obviously want to have gravity always be in the direction opposite of the vehicles local up direction. Didn’t see much about gravity in the Rigidbody documentation.
#2
__
Since I’m using a sphere collider to handle acceleration and rotation on my vehicle, I find myself needing to keep a local up and forward vector in the control script that is independent of the current Transform (The spinning of the wheel via the sphere collider seems to muck with the Transform’s forward vector).
The up vector is simple, I am just raycasting downward, and taking the surface normal.
However, keeping a local forward vector is proving to be a problem. Theres probably a simple way to do this in Unity, but I just can’t think of a higher level way to do it. The local forward vector is simply the positive Z axis in object space, but I’m not sure how to access that?
If anyone has any advice I would greatly appreciated it. I’m used to doing things at a much lower level in straight DirectX or XNA.
Thanks in advance,
-Bruno Sommer