PositionEntity mayhem

Blitz3D Forums/Blitz3D Programming/PositionEntity mayhem

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

try positioning the Entity Then Resetting?

sounds like your declaring the collisions BEFORE your positioning

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!

what do you mean by resetting?
I do
Collisions playerCollisionType , mapCollisionType, 2, 3
in the beginning of the game, nothing more :)

aaah Ross you posted while I was responding. :) gonna try it out now!

GREAT this worked! FINALLY!

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

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.