positionentity
Blitz3D Forums/Blitz3D Beginners Area/positionentity
| ||
Ok, i thought this was strange perhaps someone can clear this up for me. I have a player, and a projectile.. I shoot the projectile from the player position, it moves until it hits somthing.. when it does the player is warped to the collision area. The strange thing is that the player must be in a open line of sight to the area that I want to position him at. otherwise posisitonentity does nothing.. It would seem as though it is checking collisions between players current position and the new destination via PositionEntity. I did not think that positioinentity was supposed to use collision detection. It would seem that I was wrong it that, but i tried to remove the collision typwe from the player then reposition then reapply the collision type.. but far to often he falls through the level with that method.. Any advice here? |
| ||
Just a thought.... Maybe fill the level with a series of "volume zones"...basicly a series of alpha zero pivots with a rectangular collision structure around them defineing a volume of 3D space... As the player shoots the projectile...set-up sphere to "volume" box collisions with a seperate child pivot of the projectile...then as the projectile flies to it's destination keep a "pointer" to the "volume" box it is passing through...when the projectile hits something, turn off the player collisions, position them at the last "volume" box pivot point, turn the player collisions back on and move them to the point where the projectile hit... This way the player can pass by level obsticals, yet still use the same collision system to avoid being teleported directly into a wall/floor/etc.. |
| ||
I've heard that Positionentity works the same way as moveentity and will check collisions between it's last position and new. You will have to reset the collision or use hideentity before using positionentity I think. |
| ||
you need to set entitytype of the bullet to zero, then position it, then updatworld, the set entitytype back to the wanted type. so better set a flag to 1 to signal an IF statement after updateworld that the entitytype should be restored. something like: if bulletbacktogun entitytype bullet,0 bulletsetjob=1 positionentity bulletx,x,y,z endif ... updateworld if bulletsetjob=1 bulletsetjob=0 entitytype bullet,4 or whatever endif renderworld ... |
| ||
wouldn't this just work?thats how i've done this kind of thing and it's seemed fine if bulletbacktogun entitytype bullet,0 positionentity bulletx,x,y,z entitytype bullet,4 or whatever endif |