Help with Modeling Tank Collision Physics Using Shapecast

Hi everyone!

I’m working on a tank game in Roblox and trying to simulate collision physics with the terrain. I’m using Shapecast to detect the collision point, but I’m having trouble figuring out how to rotate the tank tangentially to that point while keeping it in the same position and ensuring it continues to face forward.

Here’s what I’m trying to achieve:

  1. The tank should rotate based on the collision point (tangentially to the surface).

  2. The tank’s position should remain unchanged.

  3. The tank should still face forward (maintain its general direction).

I’m not using Roblox’s default physics, so I’m handling collisions manually. Could anyone provide guidance or code examples on how to achieve this? Specifically, how to calculate the correct rotation and apply it to the tank’s CFrame without moving it?

Like this:



Thank you!

Like this?

1 Like

Yes, just as I wanted! Thank you!

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