PositionEntity and Collisions

Blitz3D Forums/Blitz3D Programming/PositionEntity and Collisions

Tracer(Posted 2003) [#1]
Stupid question time...

Can someone explain to me why when i PositionEntity something, it collides with my level??? I'd assume that MoveEntity actually MOVES an entity, and that PositionEntity actually POSITIONS it.. but apparently, PositionEntity moves it too.. just really quick in one frame.. seems kinda odd.

I solved it by parenting the entity in question to it's "emitter" upon CopyEntity and then unparenting it, which solves the problem just fine but it seems odd :)


To clarify, i have a 'bullet' entity that sits hidden at some x,y,z location.. when the player shoots, the bullet gets CopyEntity'd and then PositionEntity'd to the player's location.. this collides with the level... odd? The above works fine, but i just wanna know why PositionEntity moves the entity instead of just plopping it down where you tell it to go instead of it trying to go through walls :)

Tracer


semar(Posted 2003) [#2]
Use ResetEntity after Positionentity.

I also though that PositionEntity should just place the entity without being affected by collisions, but The Ma... ooops, sorry, Mark Sibly has told me that PositionEntity is indeed affected by collisions (of course, this is true only for entityes which a collision has been set for.).

http://www.blitzbasic.com/bbs/posts.php?topic=22760

Look also my last post, I hope that helps.

Sergio.


Tracer(Posted 2003) [#3]
Thanks,

I'd figured that out as well.. but it doesn't tell me WHY PositionEntity behaves this way.. it just seems so 'wrong' for it to behave this way you know :)

Tracer


semar(Posted 2003) [#4]
Same for me.

I think it can be used to check for collisions without using Moveentity.

So if you shoot a very fast bullet, which (would) hit the target, then it remains at starting position, and you can check for its collision to determine if the target (would have been) hit or not.

Instead, using moveentity, you have to check for collision at each move.

PositionEntity could so be used instead of PickEntity, if you play with collisions.

For example, since MD2 models are not pickable, you may find PositionEntity useful for fast bullets.

Sergio.


_PJ_(Posted 2003) [#5]
I didn't expect it, but I do think it's useful PositionEntity works in this way. I know now my spawn objects will still work if they spawn on top of the player etc.


Todd(Posted 2003) [#6]
You could also just hide the source entity (the one you're copying) and then once you have it copied and positioned where you want it, use ShowEntity and make it visible.