Topic: Prevent character from getting knocked into the air

I'm trying to make an enemy that is always on the ground (it's a carnivorous plant similar to the one from Mario). Is it possible to make the plant always stay on the ground even if it gets hit with knockback attacks or attacks that throw you into the air?

The enemy itself can still move back and forward, but I just want it so that it stays grounded at all times.

Share

Thumbs up Thumbs down

Re: Prevent character from getting knocked into the air

Under PhysicsScript.ApplyForces, add a line right in the beginning of the function:

if (controlScript.myInfo.characterName == "Plant") activeForces.y = 0;

Change "Plant" to whatever the character name is.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.