Clamping position of rigidbody, value goes above

Bolter 4 years ago 0


i recently buyed Bolt and i'm doing the tutorial from unity "Visual Scripting With Bolt" where they are making a Space Shooter with Bolt.

I'm trying to make the boundary so the player ship can't leave the play area. I'm trying to clamp the position of the ship to a specific min and max value as in the tutorial. The ship shouldn't be able to go beyond the value 8 in the Z axis but it can go to 8.2. If i'm not moving it goes back to 8. It depends on the velocity how far the ship goes beyond it.

Is this working as intended? Because i don't like it that way. It actually slows down movement in that axis. In the tutorial it seems to work fine. As far as i understand it, it shouldn't be able to go beyond 8.

Here is a picture from the graph. As you can see the position goes beyond the value of 8 to 8.2.

Here is the video. He starts making the boundary at 2:00.

What would be a better way of doing this?

And while i'm at it, two more questions if i may:

1. I'm thinking about making a voxelstyled game. So i would create a model in MagicaVoxel and then import it to unity. But a voxel is 1 unit long. So i would have a large play area with for example 300x400 units. I read that large areas could cause problems with the physics engine. Should i scale it down?

2. Everytime i see a video about making a space shooter, the 0,0,0 coordinates are in the middle of the play area. I thought about having it at the left bottom corner. Is there a good reason for it to have it in the middle or is it just a matter of taste?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):