Alright I finally got my interaction to work as well as some of my leaning code. The problems are:
1st, and most important. Depending on which way I am facing inside the game I lean a different direction. Ie. If i am facing north Ill lean to the east. But if I am facing south i will also lean to the east. I dunno what function to call to fix this I though maybe put GetViewRotation() inside of my GetAxes function, but that was a bust.
2: I am not good with vector math. I want to call FastTrace what is the algorithm for stopping the trace at a given location? IE. I want to check if I am too close to a WALL TO LEAN.
any help is appreciated, here is my code snippet.
1st, and most important. Depending on which way I am facing inside the game I lean a different direction. Ie. If i am facing north Ill lean to the east. But if I am facing south i will also lean to the east. I dunno what function to call to fix this I though maybe put GetViewRotation() inside of my GetAxes function, but that was a bust.
2: I am not good with vector math. I want to call FastTrace what is the algorithm for stopping the trace at a given location? IE. I want to check if I am too close to a WALL TO LEAN.
any help is appreciated, here is my code snippet.
Code:
simulated function LeanRight()
{
local vector X,Y,Z, TraceStart;
local vector TraceEnd;
local rotator r;
GetAxes(Rotation,X,Y,Z);
TraceEnd = -X;
TraceStart = Location + (default.EyeHeight + Default.CollisionHeight - CollisionHeight) * vect(0,0,1);
TraceEnd = EyeHeight * Vect(-128,0,1) + walkbob;
if(FastTrace(TraceEnd, TraceStart))
{
log("we hit world geometry");
return;
}
r.Pitch = -10000;
SetBoneDirection('spine',r);
bIsLeanedRight = true;
return;
}