Question by
ADamnPorch · Jul 22, 2020 at 02:54 AM ·
raycastcollider2d gamecollider2dprojectile
How do you make one game object follow the shape of another game object?
I'm trying to make a gun for my 2D platformer that shoots projectiles similar to Pikachu's neutral special, the one that bounces along the ground, in Super Smash Bros. I believe I can accomplish this by creating an object that follows along any given 2D Collider on a specific layer. My current method is to use ray casts to check if the object is over an edge and then change the direction of the object. The problem is this only seems to work if the object is traveling Clockwise around the outside of whatever the layer is or Counter Clockwise when traveling along the inside. is there a more efficient way to make an object essentially trace another 2D collider?
Comment