Question by
Hawknasty13 · Oct 08, 2018 at 09:28 PM ·
instantiatecombine
How to join two instantiated objects also join them to everything else in the game?
I am making a game where my character throws snowballs. I want the snowballs to stick to each other as well as stick to other objects in the game such as terrain, rocks, walls, etc. Should I use joints for this or should I parent them on collision? Also how would the code look??
Thanks
Comment
Answer by tormentoarmagedoom · Oct 08, 2018 at 10:53 PM
Easiest option is just detect OnCollisionEnter, and make it child of the impacted object.
Code is simple, you should be able to do it by your own, you will need to use colliders so many times in the future.
look for how toi detect with Oncollisionenter
look for changing parent of an object.
Bye!