Hi all!
I just made a really nice effect. When my character hits something I activate a blood fx. The problem is that as long as I hit anything it keeps on playing the fx forever. I want it to play it just once only.
It's really hard to post a code somewhere but I used the exploding barrel and goal trigger as inspiration when creating this effect.
Here are some snippets:
void ApplyDamage( Object@ object, float value)
{
{
PushFullPath( object.GetFullPath());
GetFXManager().CreateFXAtPosition( explodeFX, hitPosition);
PopPath();
}
}
and
void CollisionCallback( Object@ object, Object@, ObjectCollide@, ObjectCollide@, const Vector& in worldPos, const Vector& in normal)
{
{
hitPosition = worldPos;
hitNormal = normal;
ApplyDamage( object, health);
}
}
I guess there needs to be some if's and while's there somewhere
