ay up,
OK, so I seem to be struggling getting my head around how collision information can be gleaned between two objects, as in if A collides with B, let a function in scriptX know about it and act on it.
what i ultimately want to have is when an obstacle collides with the player, i can capture that collision in a script somewhere and do something with it ( ie decrease health, remove the obstacle instance the same way as the area collisions work) so here what I currently have, and as you can see the collisions do work, i just cant figure out how to tie the signals/script in together so i can remove the obstacle once it collides with player.
as a brief description of what i have, its a little game im trying to create from scratch, much like temple run, where the player and ground are stationary and the obstacles come down the lane towards player.
firstly here is my Scene tree in the main level.
here is the player scene
the player and obstacles are instantiated scenes (player doesnt have to be) , obstacles are for instancing purposes.
heres the obstacle scene
the obstacles are spawned at the end of the lane and travel towards the player
at the rear behind player is an Area Collision Object.
when the obstacles collide with this they are freed up. this part functions correctly.
as the Area has a body_entered signal that is attached to a script on Spawners