Tank is flipping out

It looks like collisions conflicting with each other but I’m not sure which. I didn’t see Sam change any of the tank’s collision meshes or settings outside of the tracks, and his cubes are clearly embedding within the tank body when the sprung wheels are active.

Any suggestions?

https://vimeo.com/427306527

Could you show how they’re attached? e.g.

I’ve moved on to trying to create the wheels but basically the constraint joint is up near the top of the tank tread and the cube started just below the bottom of the tread, then was moving up a bit so that the tank didn’t end up too much higher on the ground. The treads already have OverlapAllDynamic set as their collision mode.

If you go into the blueprint and look at it on the side what does it look like? It should look like this
image

Well, this is getting slightly beyond the scope of the original lecture. But I’m up to this part now anyway… so. Yes it looks basically like that:

I have the top-level (spring) constraint as the root, the axle parented to that, and the axle constraint and wheel parented to the axle:

image

I’m now getting these weird console messages (when it is used on the tank) about the constraints themselves and the physics not being set up correctly:

PIE: Warning: Constraint in '/Game/Experiments/UEDPIE_0_PhysicsTest.PhysicsTest:PersistentLevel.SprungWheel_BP_C_0.AxleConstraint' attempting to create a joint between objects that are both static.  No joint created.
PIE: Warning: Invalid Simulate Options: Body (SprungWheel_BP_C_0.Axle) is set to simulate physics but Collision Enabled is incompatible
PIE: Warning: Invalid Simulate Options: Body (SprungWheel_BP_C_0.Axle) is set to simulate physics but Collision Enabled is incompatible

I have the wheel set to Custom collision profile, with collision enabled (query + physics). It’s not clear to me what the correct mode for the Axle should be but the tank either flips violently (OverlapAllDynamic) or just falls through the floor (same mode as wheel).

I’ve just opened up the course repo and had a look at where things are at in the lecture with the wheel added and two constraints. Code-wise everything seems more or less normal on my side but I’ve noticed that the specific physics settings were glossed over a bit in the lecture. Specifically:

  • Axle: Custom collision setting, Query+Physics enabled for collisions, Object Type must be WorldStatic.
  • Wheel: Physics Actor collision preset.

Setting these two settings seems to have fixed things for the moment, although I’m going to continue playing with things as it’s not 100% there.

Another thing I just noticed, and I think this causes the problem with the error messages I mentioned above (not being able to create a constraint between allegedly “static” components) - I had the setting up of the axle constraint components in the ASprungWheel constructor rather than BeginPlay (as I originally set up all of this stuff there, including every single physics and constraint property in C++). Apparently that breaks it.

Moving the constraint relationship setting up on the axle to BeginPlay fixes that error message, and should also fix the physics in principle.

It’s not quite clear from your posts but it seems you have everything working, more or less?

Never 100% confident to say, but let’s go with yes. Thanks for the help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms