ParentPlayer
in Player
script. And you want to assign instantiated object as the child of Player
. So the possible way to achieve this is to instantiate your object first, set it as child and then set the transformations to identity because after setting it as child its transformations will become relative to parent.PlayerProjectileDoom
script. You did implement OnTriggerEnter in wrong way. You should be careful when you are implementing these messages.Destroy
in Update
method, however it will work if you put it in Start
. I'd recommend use Update
at least as possible and absolutely not for these kind of events.OnTriggerEnter
or OnTriggerEnter2D
will execute only iff you set colliders as Trigger
. You can see this Trigger
check in Inspector by selecting that gameobject having any collider. But if it is not set to Trigger
then you should use OnCollisionEnter2D(Collision2D coll)