Hello!
I have a question that I have been trying to answer for a long time.
How can I make my character eat animated food, that is to say that when he eats, if for example he is eating a pizza, that as the character does the eating animation, the pizza will disappear in pieces, basically like arthur eats in rdr2.
Do you know how to do it or any animated food asset?
Hey there @KarNakYT! Welcome to the community! So there’s a bunch of ways to pull this off. I’ll list a few from a high level point of view, and you can decide which sounds the best for you.
Disclaimer: Epic Games is not liable for anything that occurs outside of this domain. Follow any external links with care.
Best Practices:
-
Masking a material/texture with transparency out the more that’s eaten. Say every time the player eats a piece, more of the material/texture is masked out. You could do this with a pattern and move it based on parameters as well. An example of this in action: Unreal engine 5 material opacity mask beginner tutorial - YouTube
-
If your food needs to be way more complex, you could animate them like you would a character. If so I’ve seen Morph Targets being used. Morph targets are blend shapes if you use other software like Maya. Every time you take a bite, you blend down quickly to the next target and change the material as necessary. Example: Unreal engine 4 tutorial: How to use Morph targets from Blender - YouTube
Not so great practices:
- Making a separate mesh for each step and just replace the mesh each bite, or destroy added branches. This is cumbersome to do, albeit easy to pull off.
Let me know if you have any questions!
Thanks, i will try it!
There are bunch of ways I will try to make it easy for you, You can follow these steps and let me know if you have any confusion
Firstly, you’ll need an animated food asset that allows for different states (whole, bitten, etc.). You can create or find such assets on platforms like the Unity Asset Store or other 3D model repositories. Once you have the asset, you’ll need to set up a system for transitioning between the different states of the food item during the eating animation.
In Unity, you can use animation tools to keyframe the transitions between the whole food item and various bitten or eaten states. You might also want to use scripting to trigger these transitions based on the progress of the eating animation.
Additionally, you’ll need to synchronize the character’s mouth movement with the eating animation and make sure it aligns with the disappearance of the food. Unity’s animation system and scripting capabilities can help achieve this synchronization.
Remember to consider the visual and audio aspects to enhance the eating experience. For example, you can add sound effects for chewing or utensil clinking.
Overall, creating a realistic animated eating sequence involves a combination of finding the right assets, setting up animations, and scripting interactive elements in your game engine, such as Unity.