I'm trying to export the tree animation I made in Blender with the Sapling Tree Gen plugin to Unity. In Blender everything is normal, but when I play the animation in Unity it's too fast. I already tried locking the Unity framerate to 30, but it doesn't change. Is there a way to slow down the animation?
Yes,
first make sure you have made an animator component for your object(tree), then create an animator controller in your assets folder and open it, then add the default animation from your imported object to your animation controller (it should be in your assets folder) and at last, by clicking on your default animation in animator controller you have access to speed and other properties related to your object.
Related
I'm having some interesting behaviour with NavMeshAgents. So I've been working on a project for the past few months which is revolving around creating believable enemy AI systems for stealth games. When the player kills an enemy they can pickup the body and put it into a body bag, this all worked well and fine for a while but now once the player has picked up two corpses all Nav Agents do this.
They are still in their patrol state (using a behaviour tree) and all of the AI have a destination set which can be seen on the debug tools for the Agent. However if I try to move the AI whether that being dragging them around or setting a position through the inspector they will snap back to a corner of the NavMeshSurface.
Using Unity 2021.1.17f1 and using the latest compatible version of the NavMeshComponents package provided by Unity.
Things I've tried:
Changing Radius and Height of agents
Setting the floor and such as navigation static objects
Removing the NavMeshComponents package scripts and replacing them with the original NavMesh system. Didn't work and took a lot longer to build the NavMesh
Interesting behaviour:
The amount of body bags the player has to pick up seems to be related to how many AI are in the scene. For example currently there are 23 AI and it takes two body bags for this glitch to happen, but if there are 24 to 31 AI in the scene then it requires three body bags to be picked up for it to happen.
All calls to the NavMeshAgent are done through a AILocomotion script which handles enabling and disabling rotation, movement and updating the animation. Movement is only disabled upon death or when the AI is in the wait state, other than that every Move based state re-eneables movement.
Update: Found the solution
It turns out Unity does not like it when you destroy a NavMeshAgent component during runtime. Now when the player picks up a corpse it leaves the NavAgent behind but destroys the mesh and colliders etc.
I am currently writing a 2D game in unity and whenever I build the actual game, the sprites all disappear, the player is the only thing that remains.
However, the sprites are still there, just invisible. It's not an issue of order of layer and am having trouble fixing it.
I am using SpriteShapeController.
SpriteShapeController auto shows as it having a sprite so it made me think I had a sprite already
I just made Custom Square Sprites and added them in.
I'm newbie at unity animations and stuff and I want to create a game scene in which at run time I would be able to move a humanoid 3D model and save the movement as an animation (.anim) file.
I may move the parts of the model by mouse or by mapping scrolling bars to animation property values, somehow.
To do all this I decided to go for the animators (properties) of a model. Kindly look at the picture in the link below to know exactly what I am talking about. (Wasn't able to post image since I'm new to stack overflow too)
I searched the unity Scriptable API for this but wasn't able to find the documentation on how to use the above mentioned property directly in your scripts so that animation curves can be generated from them.
Is it possible to do this?
Is there a better way to record animations of humanoid models at runtime (in-game mode) or a better property for humanoid models to use?
Note: The whole animation process is to be handled through code.
When using the unity editor all animations tied to the camera work, but when build and deployed onto the hololens the animation wont process(being overridden by real life coordinates), the way to get around this is by attaching it to a random gameObject. My issue is giving the user the ability to roam around space whilst tying animations and force movements to the cameras parent(empty gameObject).
I have tried making the gameobject stay where the camera is but obviously this just makes for constant motion.
Is there any way to keep the cameras parent exactly where the camera is in order to stop the animations going glitchy?
I am making a 2d game in Unity, and for the main character I have created 4 animations; up, down, left, and right. To do this I just made the animation and trigger them with a line of code like this:
anim.SetBool ("movingUp", true);
which would happen when the up key is pressed. This type of animation is easy to deal with because it is not based on time, but how long the player wants the character to be in that state. I am now trying to add an animation that is triggered when the character collides with another game object. I am not sure how to make it so the animation will play just one time and then go back to the other animation. Is there a way to trigger an animation to play just once in Unity?
Generally speaking you don't have to code your own controller, Unity already has that one and here is the link to official Unity tutorials how to use it. What you need is to fire off a trigger just like you did upon collision and check has exit time on that animation in the controller. After that you just guide the state back to the animation you want it to go back to. Again, accurate and thorough tutorials are found online on the term Unity Mecanim how to or Animations in Unity or something like that.
MAke an animator controller and add the 4 animations into it. then make a transition between them with the Boolean. Are you doing this as an automatic animation without triggering it?