Game Development Community

Seeing if the actor is jumping?

by Do Not Delete · in Torque X Platformer Kit · 11/08/2007 (7:38 pm) · 4 replies

Can I do this to see if the Actor is jumping or not?

public class AchievementLadder : ActorComponent
    {
        public AchievementLadder()
        {
            if (_Jumping == true)
            {
                Game.Instance.toast.Enqueue("TEST", "TEST");
            }
        }
    }

Because the achievement thingy doesn't pop up when the guy jumps.

#1
11/12/2007 (10:30 am)
Bump. Please I still need help with this.
#2
11/12/2007 (11:54 am)
Dro, I still don't understand why you are inheriting ActorComponent every time.
#3
11/12/2007 (1:14 pm)
What should I be doing?
#4
11/20/2007 (11:39 am)
Well the part "AchievementLadder : ActorComponent" seems to be the problem. (this is kinda depended on how you've done this) What it looks like your doing is creating an instance of AchievementLadder which inherits all the code from the Actor.

This is similar to the other thread [link]http://garagegames.com/mg/forums/result.thread.php?qt=66900[/link] where the particle inherits the ActorComponent too. So when you created a particle it created another ActorComponent 'kinda like a kid'. It got all the code from it's parents.

AchievementLadder can be a completely separate component and then using a public method from Actor it checks whether the _Jumping is true.