gravity with plane

Blitz3D Forums/Blitz3D Beginners Area/gravity with plane

Braden(Posted 2008) [#1]
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!


GfK(Posted 2008) [#2]
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.


Braden(Posted 2008) [#3]
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???


Naughty Alien(Posted 2008) [#4]
maybe because your radius for camera is too big so it stuck on doors?


Naughty Alien(Posted 2008) [#5]
..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..


Braden(Posted 2008) [#6]
but if I make it to small, it gets closer to the plane


Nate the Great(Posted 2008) [#7]
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


Naughty Alien(Posted 2008) [#8]
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)..


Braden(Posted 2008) [#9]
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...


Ross C(Posted 2008) [#10]
I'm sure you can only specify width and height.


Nate the Great(Posted 2008) [#11]
Naughty alien I didn't know you could do that


Naughty Alien(Posted 2008) [#12]
..me neither..what i ment was actually set of different size for width and height as Ross said..


Andy(Posted 2008) [#13]
This should do it.

if EntityY(cam)<2.0 then PositionEntity cam,EntityX(cam),2.0,EntityZ(cam)


Braden(Posted 2008) [#14]
thanks