I'm getting close. Soon I'll upload videos of what all of you have been helping me with.
I'm using two SkelControl_CCID_IK's attached to b_RightHand and b_LeftHand to change my pawn's arm positioning. That's working more or less OK. (Actually, the pawn's hands are always the same distance from the torso regardless of how far away I'm holding the controllers. I'd prefer for the elbows to bend depending on how far away the controllers are, but I can save that for another day.)
I'm trying to use two UDKSkelControl_LockRotation's attached to b_RightWeapon and b_LeftWeapon now in an attempt to control the guns' directions.
The thing I'm having trouble with right now is pointing the guns independently of where I'm holding the controllers. The Sixense can detect the controllers' location and rotation. I have the Sixense's location set as a vector, and the rotation set as a quaternion, and the gun points along the location vector regardless of which way I'm pointing the controller.
In my PlayerController class I have this:
That all comes after loading the appropriate data into the ArmLocation vectors and weapon quaternions. Pay no mind to the Utp reference. There's no UT stuff in here (well, except for the meshes and skins). I just never changed that from a tutorial I was reading.
Like I said, the arm location is working right, but the gun direction doesn't seem to be doing anything at all.
Just in case it's relevant, this is in my Pawn class:
Any idea what I'm doing wrong here? Thanks as always.
Edit: Oh, and full disclosure: I haven't yet attached a gun to the left hand. If I can't figure that out, I'll ask about it in the future. Here's how I'm attaching the gun to the right hand, for now using a function in PlayerInput:
I'm using two SkelControl_CCID_IK's attached to b_RightHand and b_LeftHand to change my pawn's arm positioning. That's working more or less OK. (Actually, the pawn's hands are always the same distance from the torso regardless of how far away I'm holding the controllers. I'd prefer for the elbows to bend depending on how far away the controllers are, but I can save that for another day.)
I'm trying to use two UDKSkelControl_LockRotation's attached to b_RightWeapon and b_LeftWeapon now in an attempt to control the guns' directions.
The thing I'm having trouble with right now is pointing the guns independently of where I'm holding the controllers. The Sixense can detect the controllers' location and rotation. I have the Sixense's location set as a vector, and the rotation set as a quaternion, and the gun points along the location vector regardless of which way I'm pointing the controller.
In my PlayerController class I have this:
Code:
RightArmLocation = RightArmLocation >> ViewRotation;
LeftArmLocation = LeftArmLocation >> ViewRotation;
Utp = MyUnrealGamePawn(Pawn);
Utp.RightArmIK.EffectorLocation = Utp.Location + RightArmLocation;
Utp.LeftArmIK.EffectorLocation = Utp.Location + LeftArmLocation;
Utp.RightWeaponRot.LockRotation = QuattoRotator(RightWeaponQuat);
Utp.LeftWeaponRot.LockRotation = QuattoRotator(LeftWeaponQuat);
That all comes after loading the appropriate data into the ArmLocation vectors and weapon quaternions. Pay no mind to the Utp reference. There's no UT stuff in here (well, except for the meshes and skins). I just never changed that from a tutorial I was reading.
Like I said, the arm location is working right, but the gun direction doesn't seem to be doing anything at all.
Just in case it's relevant, this is in my Pawn class:
Code:
simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
{
super.PostInitAnimTree(SkelComp);
RightArmIK = SkelControl_CCD_IK( mesh.FindSkelControl('RightArmIK') );
LeftArmIK = SkelControl_CCD_IK( mesh.FindSkelControl('LeftArmIK') );
RightWeaponRot = UDKSkelControl_LockRotation( mesh.FindSkelControl('RightWeaponRot'));
LeftWeaponRot = UDKSkelControl_LockRotation( mesh.FindSkelControl('LeftWeaponRot'));
}
Any idea what I'm doing wrong here? Thanks as always.
Edit: Oh, and full disclosure: I haven't yet attached a gun to the left hand. If I can't figure that out, I'll ask about it in the future. Here's how I'm attaching the gun to the right hand, for now using a function in PlayerInput:
Code:
simulated exec function TestFunction1()
{
local MyUnrealGameWeapon TheWeapon;
local MyUnrealGamePawn ThePawn;
ThePawn = MyUnrealGamePawn(Pawn);
TheWeapon = ThePawn.Spawn(class'MyUnrealGameWeapon');
TheWeapon.GiveTo(ThePawn);
}
Last edited: