gravity with plane
Blitz3D Forums/Blitz3D Beginners Area/gravity with plane
| ||
When I use gravity with my project, The camera goes all the way down to the plane, I would like it to stop about 0,2,0 above it. The collision between the 2 works fine, but when I add the EntityRadius code to the plane, nothing happens... What could I do so the camera stays above the plane at about 2 points above the plane? thanks for your help! |
| ||
EntityRadius isn't used during polygon collision. I'm assuming your using sphere-to-polygon collisions. The sphere part is the camera, the polygon is the plane. You need to apply a change to the camera with EntityRadius, not to the plane. |
| ||
I set the radius for the camera and it worked, the camera does not collide with the plane. But now the camera ccan't get through some doors... any help??? |
| ||
maybe because your radius for camera is too big so it stuck on doors? |
| ||
..try to use createsphere() with same scale factor/size as your collision radius so you can visually see whats going on and where your colliders stuck.. |
| ||
but if I make it to small, it gets closer to the plane |
| ||
so make a pivot with a different entity type that is parented to the camera and give it a smaller entity radius so it can collide with the doors and walls etc... Keep the camera type but don't allow it to collide with the walls or doors |
| ||
as i said..you can scale your collider entity(sphere for example) so it can be thinner on X,Z while height (Y) remain same(so your camera will not be closer to ground).. |
| ||
ok, so to scale the collide entity, would I add the x,y,z cordinates to the entityradius code? I'm going to try it now... i tried it and it didn't work, it said there were to many peramiters... what were you explaining about the createsphere thing? it sounded promising... |
| ||
I'm sure you can only specify width and height. |
| ||
Naughty alien I didn't know you could do that |
| ||
..me neither..what i ment was actually set of different size for width and height as Ross said.. |
| ||
This should do it. if EntityY(cam)<2.0 then PositionEntity cam,EntityX(cam),2.0,EntityZ(cam) |
| ||
thanks |