I use this:
Code: Select all
//Given a target actor, attach ourselves to it, and align to the Z axis of the target
function AttachToActor(Actor Target) {
local Vector X, Y, Z;
local Rotator DesiredRotation;
//get the x,y,z axis as vector directions
GetAxes(Target.Rotation, X, Y, Z);
Self.SetOwner(Target);
Self.SetPhysics(PHYS_Trailer);
//ensure we are offset by a fixed amount from the owner
Self.bTrailerPrePivot = true;
//ensure we dont use the owner's rotation
Self.bTrailerSameRotation = false;
//offset us slightly higher than the origin of the target -- 16 units up on the Z axis
Self.PrePivot = (Z * 16);
//get the rotation to align to the target Z normal
DesiredRotation = Rotator(Z);
//set our rotation to align TOWARDS (or Z will point in the same direction) the positive Z axis of the target
Self.SetRotation(DesiredRotation);
}
I even tried setting a timer, and calling this and inverting the Z axis vector I get, every other tick, and no change....
Ideas? am I missing something?