I have a system where if an enemy is hit they are knocked back away from the player. I use the node, Launch Character. I have a flying enemy whose movement mode is set to flying. When I hit the flying enemy it should only launch them backwards in a straight line without effecting their world height. But when I hit then and the Launch Character node runs, they fall to the ground. It says their movement mode is still flying but gravity is effecting them as when I change the gravity scale it effects their fall speed. Is there any way to use the Launch Character node and it not make the flying character fall to the ground?
Hey @Queso_berry!
Select the Character Movement Component from the Components window on the top left, then while having it selected, navigate to the Details window on the right side, search for “gravity scale” and set the property to 0 like this:
Hope this helps!
Didn’t really get that You mean you’ve tried this but the issue persists? I was able to achieve your objective of launching the character while keeping it in the air upon setting the gravity scale to 0. In that case, get back to us sharing some screenshots on the related parts of your character and preferably a video showcasing the issue to make sure that we’re on the same page.
I had the gravity scale set to 0, and got the same results. I found a solution for me that I will put below. Thanks for your input!
The solution that worked for me was to deactivate the character movement component of the AI after 0.2 delay. That stopped the character after the Launch Character node had its intended effect but before gravity effects the character. I then turned the character movement back on after a 0.05 delay so it immediately turns back on.
I recognize this might not be a solution that works for other with this problem, but it worked for my goal so I wanted to list it here.
Also adding ‘Set Movement Mode’ to flying at the end of the code makes it work even better.