Godot Engine

Godot Engine

Rogue_Zephyr Feb 21, 2018 @ 4:24pm
[SOLVED]How to flip a 3d character based on the direction he is facing?
How would one go about making a 3d character or model for that matter flip horizontally to face the correct direction. I know in the 2D part of Godot you can use flip_horizontal function but I'm not sure how this would be done in 3D other than the character needs to rotate. The documentation also isn't very clear on this subject either. Can anyone please shed some light on how to go about coding moving in the direction the character faces?
Last edited by Rogue_Zephyr; Feb 23, 2018 @ 10:01pm
< >
Showing 1-4 of 4 comments
Valdar Feb 21, 2018 @ 10:10pm 
Have you looked at any of the demos from godotengine.org (click the download tab)?
For straight up 3d, look at
3D Platformer Demo https://godotengine.org/asset-library/asset/125
or the
3D Kinematic Character Demo https://godotengine.org/asset-library/asset/126
Also, have a look at Truck Town Demo at https://github.com/godotengine/godot-demo-projects/tree/master/3d/truck_town

You typically don't "flip" in 3d. Flipping implies only 2 possible directions in which your character can face...That's the whole point of 3d, to be able to face in any 3 dimensional direction and see the 3d render from whatever angle the camera shows you at any given moment. You simply rotate the player object(s) on the x, y, or z axes to “point” in the three dimension direction you want.

You CAN have what some term as 2d in a 3d world, which is basically "billboard” assets with a fixed-rotation camera in a 3d environment, though I don’t personally see the point. If you are going to go to spend the added effort to build a 3d world, why not make your players 3d as well?
Last edited by Valdar; Feb 21, 2018 @ 10:11pm
Rogue_Zephyr Feb 23, 2018 @ 5:57pm 
Hey Valdar, thanks for the response and sorry for the late reply. I see what you mean and I will have a look at those demos/example files. I'm just stuck at the moment on if I want to go strict 2d or 3d. The thing both sides are interesting, I have more experience in 3D but I thought I would make pre-rendered 2D graphics although that probably won't work out too well and I want perspective in my game and a sense of "Depth." I suppose I will take a chance on the 3d route, the only thing that kind of stops me mostly is the amount of work and shaders. I'm probably gonna end up going with something toon-like but those were kind of the only things stopping me and making certain effects that would be easier to do in 2d like a sword slash. Anyways I'll have a look into those but thanks for taking the time to answer my question.
Valdar Feb 23, 2018 @ 6:54pm 
No problem, Renegade. Hope another perspective helps. I totally hear ya on the dilemma of whether to go 2D 2.5, or full 3D. I’ve debated the same issue many times as well. There are lots of factors to consider. Probably the biggest is the amount of time you have to spend (or willing to spend) on it. A couple more sources of information…

Regarding a 3d sword slash for example, have a look at Adobe’s Mixamo site https://www.mixamo.com. There are tons of free prefab 3d animations there. You can even upload your own 3D toon and have it customized for different animations. Once your download the finished animation, bring it into Godot, Blender, or other 3D modeling program. There you can see exactly how the bones are being moved in time frames and alter them if needed.

As for shading, you don’t HAVE to do any shading at all, but if you are new to it, here is a great primer. https://gamedevelopment.tutsplus.com/tutorials/a-beginners-guide-to-coding-graphics-shaders--cms-23313 .

Another option that might suit you is to go old school and use a fixed rotation camera in a 3d world with billboards for everything, but have 8 different billboard assets for each moving character. So if you are moving East (right), you use model A which faces right… if he turns and walks/runs toward the SE, you swap the model to one that appears to be facing SE (right and downward), and so on for the remaining directions. This still gives the illusion of movement, albeit, not fluid, but it would be far less work and provide more depth than 2d. You can even animate the walk/run/slash into the 2d billboards. I hope that made sense. Have a look at some of the early pseudo 3d games to see what I mean. It’s been awhile, but I think that Age of Empires used a similar technique. It’s also a lot friendlier on the frame rate of potato PCs :) . Hope some of this helps and good luck with your project.



Rogue_Zephyr Feb 23, 2018 @ 9:13pm 
I definitely will have a look, just gonna go with the 3d since I mean currently I'm a 3d animation major/animation in college right now so I guess it will help me with my portfolio. Even though they use maya and I use blender for personal work, it all still has the same functionality. Thanks again for the resources, I appreciate it.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Feb 21, 2018 @ 4:24pm
Posts: 4