• 3D
  • Making a general boundary/invisible wall ??

Although very early, I want to export the bit I have of the game for some people to test out without them having Godot or anything. To make sure they don't drive into the end of the world, I thought I would create an invisible boxshaped barrier around an area. So I thought just a StaticBody with a box collisionshape would suffice, but it starts flipping out. I don't know if it's because I already have a floor with a collisionplane on it. But if I disable the collisionplane of the ground, the car falls through the floor and keeps on falling. Or is a collision box not supposed to work inside out?

Cheers

15 days later

So actually doing the same as the ground, but at different angles?

Pretty much. Don't forget that one static body can have multiple collision shapes, so you don't have to make a static body for each side of the boundary.

Ah ok... so make 1 StaticBody for the level boundaries and if I want a square-shaped boundary, I put 4 Planeshapes as child of that StaticBody? And if I want a hexagon, I put 6 Planeshapes as child of the StaticBody.

That reminds me. I used a PlaneShape as collision for the floor, as in Bastiaan Olij's car-tutorial. But I get a warning that it will be removed in future versions. What do I need to use then? And why is it being removed?

@eyeEmotion said: That reminds me. I used a PlaneShape as collision for the floor, as in Bastiaan Olij's car-tutorial. But I get a warning that it will be removed in future versions. What do I need to use then? And why is it being removed?

Interesting, I did not know the PlaneShape was being removed. Good to know! As for why, it is probably because the PlaneShape does not handle collision tunneling very well, since it has no depth (so fast moving objects easily move through it when the velocity pushes them against the plane). I would recommend using a BoxShape, with a small depth like 0.1 or even 0.01 instead.

Actually, a large depth would be a better idea in this scenario. The car, or other fast moving objects, might move so fast that they could pass straight through collision shapes!

That explains why currently, if the rocks fall straight on my "head"/car, I'm being pushed through the track. I currently have the collisionshape made without depth. I also still have to "remove" the single "U" collisionshape I have for the track. I think it was someone over here that advised me to have the sides of the track and the road of the track be seperate meshes.

@TwistedTwigleg said: Interesting, I did not know the PlaneShape was being removed. Good to know! As for why, it is probably because the PlaneShape does not handle collision tunneling very well, since it has no depth (so fast moving objects easily move through it when the velocity pushes them against the plane).

PlaneShape was renamed to WorldMarginShape in 4.0, but there are no plans to remove it as far as I know.

Also, doesn't it have an infinite depth on the other side thanks to the underlying Plane's direction?

@Calinou said:

@TwistedTwigleg said: Interesting, I did not know the PlaneShape was being removed. Good to know! As for why, it is probably because the PlaneShape does not handle collision tunneling very well, since it has no depth (so fast moving objects easily move through it when the velocity pushes them against the plane).

PlaneShape was renamed to WorldMarginShape in 4.0, but there are no plans to remove it as far as I know.

Good to know! I had not heard of any plans to remove it, but I figured I may have missed it since I haven't been paying close attention to the changes in Godot source.

Also, doesn't it have an infinite depth on the other side thanks to the underlying Plane's direction?

I think it should have infinite depth, but when I was using it a bit in Godot 3.0 (for the FPS tutorial), I found that the PlaneShape suffered from collision tunneling from fast moving objects. When compared to BoxShapes with a small depth, I found that the PlaneShape had more tunneling issues, so I just used the BoxShape instead. Maybe it's been fixed though, it has been awhile since I've used the PlaneShape. I noticed collision in Godot has gotten a lot better since then, so it would not surprise me if the PlaneShape has also improved.

So if you are checking for collision each frame, a small object (like a bullet) could be on one side of a thin wall one frame, then the next frame be on the other side.

Technically it was never touching (colliding) with the wall. It just basically teleported from one side to the other. This can affect even larger objects if they are moving fast enough.

So, in that regard, is that why, if my car jumps from the bridge, certainly at higher speeds, it tends to "sink" in the floor and than pop back up again? Actually, that popping again should then also prove that PlaneShape has infinite depth.

@TwistedTwigleg said:

@Calinou said: Also, doesn't it have an infinite depth on the other side thanks to the underlying Plane's direction?

I think it should have infinite depth, but when I was using it a bit in Godot 3.0 (for the FPS tutorial), I found that the PlaneShape suffered from collision tunneling from fast moving objects. When compared to BoxShapes with a small depth, I found that the PlaneShape had more tunneling issues, so I just used the BoxShape instead. Maybe it's been fixed though, it has been awhile since I've used the PlaneShape. I noticed collision in Godot has gotten a lot better since then, so it would not surprise me if the PlaneShape has also improved.

@eyeEmotion said: So, in that regard, is that why, if my car jumps from the bridge, certainly at higher speeds, it tends to "sink" in the floor and than pop back up again? Actually, that popping again should then also prove that PlaneShape has infinite depth.

@TwistedTwigleg said:

@Calinou said: Also, doesn't it have an infinite depth on the other side thanks to the underlying Plane's direction?

I think it should have infinite depth, but when I was using it a bit in Godot 3.0 (for the FPS tutorial), I found that the PlaneShape suffered from collision tunneling from fast moving objects. When compared to BoxShapes with a small depth, I found that the PlaneShape had more tunneling issues, so I just used the BoxShape instead. Maybe it's been fixed though, it has been awhile since I've used the PlaneShape. I noticed collision in Godot has gotten a lot better since then, so it would not surprise me if the PlaneShape has also improved.

I do not know, to be honest. It could be that the wheel sinks in a bit due to collision tunneling before the physics engine realizes there has been collision penetration and pops the car back up. I was only describing what I observed when I was working with it in the past. It is quite possible that my observations were wrong and something else was causing the issue.

There might be some small margin of this stemming also from the difference in rendering frame rate and the physics frame rate? But I doubt that it's significant.

I atleast won't need a jump that big. I think that might be fomit-inducing in VR :# . That's just something that's currently happening because of an unfinished bridge. Think I got to be careful with the collision in my game regarding VR.

That does remind me: currently my animated falling rocks have collisionshapes and are StaticBodies. When they directly fall on the car from above, it pushes the car through the track. Since it's also a "death"/respawn bit, I need to be able to program the collision between a StaticBody (from above) to a VehicleBody/RigidBody and give a proper "death"-scene. I hope that is something that is possible?