Jump to content

Tank animation with dynamics not working?


Recommended Posts

I have a tank which is rigged and has dynamics.

On a perfectly flat plane the tank drives almost perfectly in a straight line if I want to (if I want to change direction then I use the controls).

But my plane is not perfectly flat, it has some degrees of inclination (H: 4.879 °, P: -7.193 °, B: 0 °). Thus, when I let the tank drive in a straight line it goes astray after a short while, as you see in this video: https://www.dropbox.com/s/6obm7jf1kd96xj8/Video%20Aug%2012%2C%208%2013%2057%20PM.mov?dl=0 (and it's not constant...sometimes goes astray to the right, sometimes to the left)

I tried making the tank to follow a spline but that didn't seem to work...any other ideas? (I know I can use the controls but it's a pain to constantly adjust the controls to keep the tank driving in a straight line)

Link to comment

It seems dynamics don't work with splines...in the example you gave me with those tanks I don't see any dynamics applied to them. Only Xpresso.

In the second example, I have the exact same situation...everytime i play I get different results. I am wondering if the animation can be baked into keyframes and how to do it...maybe one of those times I get it right and then having it baked into keyframes will yeld the same result every time I play.

 

Link to comment

This might work for you. I've put a null in a GSG tank that points at a target on a spline. Distance to target controls speed and null local H is mapped to the motors for skid steering. I've put it on a tilted plane, and it works OK although the tank tread tends to slide off with too much steering 😀

 

gorilla tank2.c4d

 

It's how you'd drive a car IRL - making constant adjustments to the steering.

Link to comment
15 hours ago, jed said:

This might work for you. I've put a null in a GSG tank that points at a target on a spline. Distance to target controls speed and null local H is mapped to the motors for skid steering. I've put it on a tilted plane, and it works OK although the tank tread tends to slide off with too much steering 😀

 

gorilla tank2.c4d 816.27 kB · 0 downloads

 

It's how you'd drive a car IRL - making constant adjustments to the steering.

In the end, what I have done is to make a "guide" to the tank, from a rectangle placed along the path I want the tank to go. I placed the rectangle between the tank's tracks and was a bit elevated (I added also a collider tag)....so when the tank tries to go off track  it collides with the rectangle and comes back to the path (it looks like steering somehow). I made the rectangle not be seen by the renderer. And then I saved the tank animation as alembic file (without the rectangle), reimported into the scene and rendered. See the image attached. 

Thank you for your solution. How do you control the speed of the tank? I didn't get it from your explanation.

tank (2).jpg

Link to comment

It's a method I use for dynamic cars. The steering comes from the h angle to target and the speed is range mapped to distance to target. For the tank it's speed 0 at distance 500, speed max at distance 1500, so the tank keeps up with the target following at around 1000. If the target speeds up the vehicle speeds up, if the target stops the car stops eg at a road junction.

 

xp car.c4d

Link to comment
5 hours ago, jed said:

It's a method I use for dynamic cars. The steering comes from the h angle to target and the speed is range mapped to distance to target. For the tank it's speed 0 at distance 500, speed max at distance 1500, so the tank keeps up with the target following at around 1000. If the target speeds up the vehicle speeds up, if the target stops the car stops eg at a road junction.

 

xp car.c4d 354.33 kB · 0 downloads

 

I have another question now....look at the results of my tank: https://www.dropbox.com/s/sbn4q9j20fsois6/tank.mp4?dl=0

How can I make it look like it has scale? Not in the sense of size but how it moves. Now when it moves it looks like a toy because shaking of the tank as it drives is too fast. I want that shake to be smoother and slower, like a big thing with mass would do. Also, the movement of the tracks to be slower (they are tank tracks, they are big, not bicycle chains). Any ideas?

In the viewport I cannot tell how the tank moves because it's too slow (my computer is a bit slow), I have to render it to see. 

Link to comment

How is the tank moving ? Maybe I misunderstood your description of it being a dynamic tank - I assumed the tracks drive the tank. If so, the tracks should move correctly on the road. If the tracks are animated, that's just math.

 

re : too slow in viewport - if the whole tank is dynamic and high poly, that's quite hard on the pc. You can use say a cube that is dynamic and reacts in real time with the tank body as a non dynamic child that just goes along for the ride.

 

Need more info on the tank.

Link to comment
4 hours ago, jed said:

How is the tank moving ? Maybe I misunderstood your description of it being a dynamic tank - I assumed the tracks drive the tank. If so, the tracks should move correctly on the road. If the tracks are animated, that's just math.

 

re : too slow in viewport - if the whole tank is dynamic and high poly, that's quite hard on the pc. You can use say a cube that is dynamic and reacts in real time with the tank body as a non dynamic child that just goes along for the ride.

 

Need more info on the tank.

 

Here is the whole project: https://www.dropbox.com/s/82awyxurv5gcily/tank-zip.zip?dl=0 (the tank is controlled in User Data)

It has some Xpresso too, besides Dynamics. Also, has "Kinetic Calculation Group" which is what you say "you can use say a cube that is dynamic and reacts in real time with the tank body". It's hidden from the viewport now. but even with that it takes a toll on my viewport.

Even if I want the tank to speed up and leave the camera behind, I still want that tank to feel real in its movement on the road (see the video how it looks now).

Link to comment
×
×
  • Create New...

Copyright Core 4D © 2023 Powered by Invision Community