Hi!
I got referred to this thread so I'll copy the post from my own thread. Here goes:
I'm working on getting some custom vehicle animations to play (on my custom vehicle). I've copied the cicada best I could, though it still doesn't work.
In my package:
- I've got a custom vehicle ready and working (skeletal mesh, AnimTree, materials etc.)
- I've got a working animation (AnimSet).
- I've assigned the AnimSet in the AnimTree using a UTAnimNodeSequence (I also tried to use a AnimSequence). In the AnimTree I can preview my animation and it looks like it should.
In my script:
In my CustomVehicle_Content I've added my AnimSet:
Code:
Begin Object Name=SVehicleMesh
SkeletalMesh=SkeletalMesh'VH_LandBuggy.Mesh.SK_VH_LandBuggy'
AnimTreeTemplate=AnimTree'VH_LandBuggy.Anims.AT_VH_LandBuggy'
PhysicsAsset=PhysicsAsset'VH_LandBuggy.Mesh.PA_VH_LandBuggy'
MorphSets[0]=MorphTargetSet'VH_LandBuggy.Mesh.VH_LandBuggy_MorphTargetSet'
AnimSets.Add(AnimSet'VH_LandBuggy.AnimSets.animSet_Boat') RBCollideWithChannels=(Default=TRUE,BlockingVolume=TRUE,GameplayPhysics=TRUE,EffectPhysics=TRUE,Vehicle=TRUE,Untitled4=TRUE)
End Object]
Further down in my CustomVehicleContent:
Code:
VehicleAnims(0)=(AnimTag=Idle,AnimSeqs=(testboat_idle),AnimRate=1.0,bAnimLoopLastSeq=true,AnimPlayerName=BoatPlayer)]
So, how do I play this animation? I tried:
Code:
PlayVehicleAnimation('testboat_idle');
I also tried:
Code:
PlayVehicleAnimation('Idle');]
I'm a bit uncertain if it works like that though. Any help would be much appreciated =)
I've put the PlayVehicleAnimation function in my CustomVehicle and placed a`log command, to see if it runs the function:
Code:
simulated function PlayVehicleAnimation(name EventTag)
{
local int i;
local UTAnimNodeSequence Player;
if ( Mesh != none && mesh.Animations != none && VehicleAnims.Length > 0 )
{
for (i=0;i<VehicleAnims.Length;i++)
{
if (VehicleAnims[i].AnimTag == EventTag)
{
Player = UTAnimNodeSequence(Mesh.Animations.FindAnimNode(VehicleAnims[i].AnimPlayerName));
if ( Player != none )
{
`log("Play it now"); Player.PlayAnimationSet( VehicleAnims[i].AnimSeqs,
VehicleAnims[i].AnimRate,
VehicleAnims[i].bAnimLoopLastSeq );
}
}
}
}
}
The weird thing is that the animation shows up correctly in every preview window; in the animSet, in the animTree, in the PhysAsset, in the SkeletalActor... but it won't play ingame.
I know it finds the event and runs the PlayVehicleAnimation function... but no movement at all.
Help is very much appreciated =)
Bookmarks