Gday all.
I am making a very simple game where targets are launched into the air & you have to shoot them. I have made the targets pickable & set collisions on them. Here is the function i am useing.
When i added in the "entity collided" section to the function, the game ends when i pick the target & i keep geting "Object dose not exist" I get the same thing if i put the "entity collided" before the "picked" code, except i get the error when the target collides with the plane. I know the reason why it is doing this. I was hopeing someone could help me out with a way around it.
Thanks
I am making a very simple game where targets are launched into the air & you have to shoot them. I have made the targets pickable & set collisions on them. Here is the function i am useing.
Function update_target() For t.target = Each target t\targetv#=t\targetv#-.0025 MoveEntity t\piv,t\xv#,t\targetv#,0 TurnEntity t\mesh,0,t\rot#,0 EntityPickMode t\mesh,2 If picked=t\mesh score=score+10 create_puff() FreeEntity picked Delete t.target picked=CameraPick(camera,1024/2,768/2) EndIf If EntityCollided (t\piv,plane_col) miss=miss+1 FreeEntity t\piv Delete t.target EndIf Next End Function
When i added in the "entity collided" section to the function, the game ends when i pick the target & i keep geting "Object dose not exist" I get the same thing if i put the "entity collided" before the "picked" code, except i get the error when the target collides with the plane. I know the reason why it is doing this. I was hopeing someone could help me out with a way around it.
Thanks