Designing a platform game that allows players to spawn various, items, projectiles, etc.
Ofcourse I would like it if when you collide with your own objects you aren't harmed.
For hitboxes I was able to have the player object and the "hitbox" object have mutual variables that only take action if said variables are not even. It was manageable when the objects spawned at the same time...
When Spawning new objects however I don't know how to assign a value that corresponds with the object that spawned it.
Please send help.
Develop games in your browser. Powerful, performant & highly capable.
I think I understood what you mean and I made a little example :)
Not Bad. It's a fair solution. However It does force me to spawn the object at 0,0 for the best result as well as Designing the player characters so that their origins do not intersect.
I was considering exploiting the layer system...
I think "Spawn an Object" places objects the same layer. Therefore I could assign each Player Object to a layer. I would have had to reserve 8 layers however and I feel that might not be great.
Thanks for the Help.
Pick nearest ( spawned object) then you target that object. Cheers.