Tank AI doesn't move up a wedge

Hello there! I am trying to make my tank move up a triangle wedge. Here’s what happens: https://gyazo.com/d1b29b427f3ccf6b90bcc246c5892bcf
Any way to fix this?

  1. Check the humanoid’s MaxSlopeAngle. If it’s less than the slope’s angle, that might be why, that’s my only clue.
  2. that tank looks nice :smiley:

1 Like

Hey, it looks like you’re making an RTS game!

Turns out I’ve been messing around with RTS gameplay, and I had the exact same issue with moving my units up a ramp.

Are you using a BodyVelocity to move your unit? If that’s the case, you may need to set the force value on one of the axes to 0. You may also need to add a BodyGyro object and do the same thing to its force values to make sure the tank stays oriented properly.

If you’re moving your unit by using a Humanoid object, I would recommend setting the HumanoidState to “Physics” and see if that helps.

Good luck!

1 Like

Will try yours in a moment! Sadly, @vlopste’s didn’t work.

1 Like

I am currently using the humanoid:MoveTo() function, yet it still doesn’t work, in fact it doesn’t move at all.

Oh! Pfft, I forgot, “Physics” causes the humanoid to be unable to move on its own.

The problem I’m seeing from your video is that the tank is unable to climb the ramp, because the front of the tank hits the ramp before the tank’s “feet” touch the ramp. I figured that setting the HumanoidStateType to “physics” would fix this because it would allow the tank to tip upwards upon hitting the ramp. (Humanoids are very stubborn about staying upright.)

I haven’t worked with Humanoids in rts units for a while because of this issue. One other idea that comes to mind is setting the hull of the tank to be non-collidable with ramps (using a collision group, perhaps, so that it can still collide with other units), and leave a smaller part inside the tank unit to be collidable with the ramp. This should allow the tank to get close enough to the ramp that its “feet” can make it to the ramp, allowing it to climb up.

Let me know if this works or not. I’d really like to be of help to this issue!

I’ll test it! Looks like it should work.

So, this is what I am getting after I cancollided the whole thing, except the torso (root) part. https://gyazo.com/82d8f5aa7052a4a5d5ac9a1deb0089da

Oh wait, I think I can fix it, thanks for the help, I’ll let you know if it works or not.

1 Like

I also looked back into some of my archived places to see if I could find my own units using Humanoid. It appears that the only solution I came up with back then was to make the ramp much less steep. (About twice as long as the ramp you’re currently using.)

The unit I was using still remained completely upright whilst going up the ramp.

1 Like

Could it be something to do with the wedge? When you select the wedge does the wedge have a square hit box. I think it maybe an issue with the hit box acting as a barrier.
Try just getting a part and angling it similarly to the ramp, if this indeed is the case.

1 Like

It worked! Thank you so much! You are amazing. (When roblox physics get confusing lol)

1 Like