Problem placing a sprite on top of a moving object

Blitz3D Forums/Blitz3D Beginners Area/Problem placing a sprite on top of a moving object

3DFish(Posted 2004) [#1]
In my game demo, i'm moving a fish under water.
When the player catches the fish. It needs to splash on the water.
My problem is that I cannot seem to place the splash sprite directly above the fish, as it moves around.
The fish moves very fast and the sprite always appears
infront or behind the fish. Not directly on top of the fish.

Maybe the code should be after Renderworld.
Or After Updateworld.

Can someone help?

Thanks


3DFish(Posted 2004) [#2]
I'm using the following code:

PositionEntity sprite, EntityX(fish),EntityY(fish),EntityZ(fish)


Stevie G(Posted 2004) [#3]
Have you tried adding 10 to the (y) position i.e.

Positionentity sprite, entityx(fish),entityy(fish)+10,entityz(fish)


It may be a collision thing - you may want to post a code snippet if the above doesn't work.


_PJ_(Posted 2004) [#4]
You want to place the sprite AFTER anything that will move the fish (i.e PositionEntity, MoveEntity or TranslateEntity etc), and before UPDATEWORLD and RENDERWORLD.

Also, if the sprite is too close to the fish mesh, it may be covered up by certain polygons of the fish mesh i.e. Clipping.

As Stevie G says, try adding a bit to the 'Y' position of the fish (this is the vertical) if you still have no luck, post some of your code here :)


3DFish(Posted 2004) [#5]
Thanks for your replies guys.

I've found the problem. One splash event consists of more than one splashes. Big and small sprites.

I only saved the x,y,z location of the fish, the first time I'm showing the splash.
So the second splash appeared on the same place, behind the fish.