开发者

animating object along a path in unity 3d

开发者 https://www.devze.com 2023-03-11 13:58 出处:网络
I need to animate an object along a path. I am doing so by creating an animation like:. This works great but since my terrain is not flat it will be nice if I don\'t have to deal with the y componen

I need to animate an object along a path. I am doing so by creating an animation like:

animating object along a path in unity 3d

.

This works great but since my terrain is not flat it will be nice if I don't have to deal with the y component. In other words I want to move an object along the x-axis and z-axis and if there is a small slope increase then increase the object y position. same thing if there is a downward slope. Or maybe I have to create a script where it checks to see if the obje开发者_如何学Cct is colliding with the terrain. if not then decrease its y position. I don't know if this will work meanwhile animating an object though.


I think the easiest way I can think of to solve this is for you to make the object a rigid body and use collision (probably a mesh or capsule collider if its a player character) to get it to sit on the floor.

animating object along a path in unity 3d

0

精彩评论

暂无评论...
验证码 换一张
取 消