PositionEntity mayhem

Blitz3D Forums/Blitz3D Programming/PositionEntity mayhem

Jeroen(Posted 2003) [#1]
Hi!

I'm think I'm finally going nuts.
I have a game with a character and a level (Mesh).
They do collide with eachother.
When the character falls below a certain point (water level), the player dies, and it is being resetted.

p\x = 23
p\y = 18
p\z = -144
PositionEntity p\entity, p\x, p\y, p\z 


Nothing scary huh? The gravity fall speed etc is nicely resetted to 0 when the player dies.

Now what happens: Sometimes the player is placed on the right spot, but on other occasions, it is placed NEAR the exact spot.
E.g: right above the water. This way he dies again immidiately. Or under an object. The offset is in X,Y or/and Z.

Now I had the same problem in another game I made.
PositionEntity IS positionEntity right?

This can't be happening :D


Neochrome(Posted 2003) [#2]
try positioning the Entity Then Resetting?

sounds like your declaring the collisions BEFORE your positioning


Ross C(Posted 2003) [#3]
PositionEntity, when collisions are active, acts just like MoveEntity. As Neomancer says, you'll need to disable your collisions before you use position entity :) This one had me stuck for an absolute age a while back!


Jeroen(Posted 2003) [#4]
what do you mean by resetting?
I do
Collisions playerCollisionType , mapCollisionType, 2, 3
in the beginning of the game, nothing more :)


Jeroen(Posted 2003) [#5]
aaah Ross you posted while I was responding. :) gonna try it out now!


Jeroen(Posted 2003) [#6]
GREAT this worked! FINALLY!

for people in the future, with the same issues: also updateWorld() after turning off/on collisions


Zethrax(Posted 2003) [#7]
Try using ResetEntity after you relocate an entity to re-prime its collision state. This will stop the entity from getting pulled up short at the first object it hits that it is enabled to collide with.