Cannot move object with NavMeshAgent in Unity - unity3d

I can't move uploaded models in the Unity with NavMeshAgent. They just walk while standing still. And whenever I start the game it gets it's "y" position as something different than it should be. This might be the problem but there's nothing that changes the position.

To use NavMeshAgent you need to add Rigidbody component to your uploaded model and also bake your NavMesh like terrain, obstacles and so on.

Related

Unity adding navmesh agent but why does the navmeshagent area goes on top of the object?

I don't know why, but when I tried to give a ship a navmesh agent, when played it suddenly flipped From this Normal Ship To this Flippedship. And when I check it, it is because the area of the navmesh agent is on top of the ship like this.NavMeshAgent area for the ship. Is there anyway to change it?
PlayerUnitShipRoot <----NavMeshAgent
PlayerUnitShip <----Mesh Filter & Mesh Renderer
Create a new GameObject (PlayerUnitShipRoot).
Put your orignial model (PlayerUnitShip) under it.
Add a NavMeshAgent on PlayerUnitShipRoot.
Move and rotate PlayerUnitShip to a proper position.

How to add an gameobject to an animated rig properly

I have moddeled and rigged an human in blender and I am able to play that animation in unity.
Now I am trying to add some objects to the human. For example an hat. But I cannot figure out, how it is made that the hat moves withe the animation.
I know, that the head has got the animation data. The hat does those data not have, hence the hat does not move.
How do I do this? Another scenario would be grapping sth. with the hand and that object should move together with the hand movement.
I would like to add those objects via script later on.
Thank you very much :)
In your character's rig in the unity scene,
Find the Bone that you want your target GameObject to follow, and add the target GameObject as a child of the bone GameObject in the Scene heirarchy, and position it with whatever position and rotation offset you need (In this case, on the head bone, maybe a little tipped)
In this case, you would find the Head bone of your rig, and add the Hat as a child gameobject of the head bone. Any animation you play, which modifies the bone positions should also move your target GameObject.

Should I create a shooting animation with the bullet in blender or in Unity

I have been working on a new asset for my new sci-fi game using blender and later importing it into unity. A thought has struck my mind quiet often about the animation. Should I create both the shooting pose or action with the bullet together in blender, or should I just create the pose in blender and create the bullet in Unity? To put the question in simpler terms, where do I create the bullet's movement upon shooting for a basic looking gun? Should I make it like a projectile ball, or should I make it like a small object moving forward with high velocity?
If you want your bullet to be an object then you would need to model it in Blender and bring it into Unity and then turn it into a Prefab and give it whatever custom components you want. As far as your shooting mechanic would work is up to you but, the most basic implementation would be to call a Shoot() method you create where you would then Instantiate your bullet prefab and give it a position, rotation, and presumably a velocity.
Some people forgo a model entirely and just perform a ray cast out of the end of the weapon and check if it hits something. How your shooting mechanic works is entirely up to you.

RigidBodies without Extra Physics Behavior in Unity

Currently I'm making a racing game.
I move my cars with the Transform.translate class.
Now the thing I want for my cars is not to move through each other.
I attach colliders and a RigidBody to my player car and it's working.
But my problem is that each time my CPU cars and player car encounter with each other, my player car shows unrealistic behavior like moving out of the screen or throwing away.
I know this is part of the physics engine behavior but is there a way to make the RigidBody only do one job and make objects not to move through each other not to add other physics behavior?
Any ideas?
There are just few problems:
1.You don't move Rigidbody with transform.translate. When you do this, colliders will go through other colliders.
You move Rigidbody with Rigidbody.AddForce, Rigidbody.velocity and Rigidbody.MovePosition. By moving Rigidbody with these methods, collision should be functioning properly.
2.You are not even supposed to move the Rigidbody of the car.
Use WheelCollider. There are many online tutorials on how to set them up on the internet but Unity's documentation is fine too.
WheelCollider.motorTorque is used to move the car forward or backwards.
WheelCollider.steerAngle is used to steer the car.
WheelCollider.brakeTorque is used to brake the car.
If you need further help, you can find a fully working WheelCollider samples here.

Why the player is walking through objects in scene?

Instead walking on the ground he walk through it same for the ship and debris the other objects. He stay on the ground on the terrain but all the other objects in the scene he walk through it.
In the past i added Mesh Collider to the ship sapceship and checked the Convex turned the Convex on so it worked fine. but now i tried to add Mesh Collider almost to everything in the scene and it didn't change anything.
The scene is not my own but there is nothing speical i think. A terrain camera and objects. I added the ThirdPersonController.
Maybe there is a way to solve it making a new script in c# ? So far i could not find solution.
Make sure the collider of the Player is big enought to hold the model. And also that the terrain collider is adjusted to the terrain.
Try to change Center(Y) value of CapsulCollider