The best example I found was this video for what I’m looking to (hopefully) achieve. I’ve gotten as far as pressing a button to enable/disable flight, and actually moving in-flight along the X and Y axis. But that’s about it… Doesn’t help that there’s practically no tutorials around to help with it.
Any help is appreciated!
That video looks like a complex sequence of animations. Not sure what exactly you are trying to do when you say “flying mechanics”…are you asking for someone to tell you how to animate a dragon? Because that isn’t something anyone can just “tell” you how to do. Are you asking for how to create path finding logic for a flying creature? Are you trying to figure out how to make “flight controls” for basically any flying pawn? These are all very different questions with varying degrees of difficulty to accomplish. A bit more clarity form your end would help.
Yeah sorry for being vague, you’re 100% right. What I meant was flying mechanics, pretty much being able to take off only when jumping (in the air), auto-switching to walk mode when the player collides with the ground, and how to make the player go up/down when in flight.
Well that’s still a bunch of stuff but to get you started, there are built in movement mechanics in a player character BP class, you would easily be able to switch from default “walking” to “flying” by changing the movement type, I forget what the exact nodes are but you can search for them. So on overlap with the ground or on hit with the ground etc, switch the default movement type from flying to walking. As for flight controls, there are many ways you could go about implementing them. But they all revolve around picking some button or key to direct the forward movement, left/right/up/down. You need to have some axis mapping for those movements. You can “add actor world offset”, you can give flying things a projectile movement component and modify the “velocity” vector to direct it where you want, you can use physics thrusters (haven’t done much with those personally), there are a million ways to do this just have to start building the logic yourself and see where you get. Straight up asking for “flight controls” will be hard to get here. Something more specific you have issues with later on would prob be better for us to help with.
For a starting point, the UFO in the Learn tab project Features tour 2014 has quite a good flying and hover, mechanics, you should check it out. Also, you can check out the Fish in the content example project to see that snake like wavy motion/ also the swimming motion.
I think those two projects will be a very good place to start.
Nebula Is Right.
What You need to do is somehow trigger a event / change mode when the dragon’s Claws/ Feet Touches the ground.
Else if u collide with a wall it is going to change ur mode to Walking.
However Here are the things u need to look into:
1-) Changing Movement Modes on Different events
2-) Animations - Search Youtube for This.
So an update, I was able to get the flying down and when the character touches the ground it switches back to walking. However, I can’t seem to figure out how to get him to switch to walking only when touching the ground. If he hits a wall he also switches back to walking.
My 2nd problem is how can I stop the player from going into fly mode while on the ground, as of right now I’ve got this BP for the player character
but its got the problem that I would switch to walking if I hit a wall. Any ideas?
Also if you can suggest some quick workaround for the player only being able to enter flight in the middle of a jump that’d be great!
Any help appreciated
Whatever the input is to “jump” should switch a boolean to “true” after pressed, then if the flight button is pressed it will check this boolean if true (meaning jump was pressed just before, go to flight mode, if not, do nothing) On impact with the ground set this boolean to false. As for the walking occuring when hitting a wall, you could just make your “ground” have a custom collision type and only when colliding with that type switch to walk mode.
So As I have Already Said:
Try Using a Key For Changing modes instead for example a key for landing.
also i dont get what do you mean by changing mode to only walking?. Just Set The Mode To Walking Thats it.
You Can Have A Button For Fly Or If You Want your character to fly only while falling u can try using the node “is Falling”
i can think u need to drag out a pin from the Movement Component [The Character Movement.] and then create the is falling node from there.
Also Raytracing might work. but i suggest having a collision or tag of some sort for landing.
in Bigger Worlds this might be a problem thou. but if u can get the claws of the dragon have collision it would be better
and easier.
i dont know if raytracing will work this way at all. but if u can make a raytrace for checking if there is anything downside within a small raytrace length the dragon will be able to land. Use Timers for Raytracing and use booleans so that if there is ground and user presses a specific key he will land (which might also trigger another bool)