Hello, I’m trying to create a character in my project (not player character), that’ll be traveling to random locations every 1sec and his whole movement will be only flying/floating in the air (i don’t want it to touch the ground).
I already created that “Travel to random locations” thing with “AI MoveTo” node and it works, but my character, even thought I’m spawning it in the air, every time after pressing “Start” button is slowly floating down and then all the time walking on the ground.
I changed the Default Land Movement Mode to Flying, checked the “Can Fly” option and turned off the “Simulate Physics” option (with that option turned on, my character was always hitting the ground and not moving at all).
My question is, how can I keep that character at the same height (above the ground) all the time, even when traveling to random locations?
well the simplest way to stop it failing is you can constrain the Z axis in the CMC.
however i dont think AIMoveTo is good for flying characters so this may be a temporary solution, there is 3d pathfinding plugins on the marketplace or for flying its pretty easy to make your own
You were right about “AI MoveTo” not being good for flying characters, because without it, my character is “flying” still in one place (it’s not moving, but at least it’s also not falling down).
Can you describe what you meant by “constraining the Z axis in the CMC”? There is an option to set minimum and maximum values for it, or something like that, or rather “lock it” at some certain value? Can you tell me how to do it so i could check that option?
And about those 3d pathfinding plugins, i’d like to rather avoid them. I’m still learning so i don’t want to use such things, but rather to try doing something by myself, or with basing on some kind of tutorial and then modifying it just as i want. So, can you also explain that “… for flying its pretty easy to make your own” thing? Can you give me a link to some kind of tutorial of how to do it or explain by yourself?
There is an easy way to make a flying character. Drag the mesh high up in the air, the capsule touches the ground, this way he actually is on the ground, but look like flying
i say easy in the sense that you often dont need complex pathfinding for flying since there are few if any obstacles in the air.
instead of aimoveto you can use movecomponentto on the root component, this will move directly though so if you need pathfinding you have to do that yourself and move between the path points.
regarding the constrain you can lock the Z axis to say 300 and it wont fall, however sounds like you wont need that since flying mode should work its was likely the AI making it fall before