Hi!
I’m working on a feature in which you are using a grappling hook to take out chunks of the level to use as physics objects.
The way I envision the logic working is that when my hook hits a tile with the correct layer, tag and attached script:,
- get the tile coordinate,
- get the sprite from the tile
- instantiate a box RigidBody and assign the sprite to it
- delete the tile
Right now, I am able to hit a tile with my grapple weapon and spawn an object to carry. However, I am having trouble with getting the correct sprite assigned to it based on the tile my hook hits. In addition, the tile that gets hit is not taken out.
While the debug log says the hook hits the correct tile object, it seems to be registering the wrong position.
Using Corgi Engine addon in Unity 6.000.0.35f.
The green tilemap is the I want my hook to take tiles out of. However, the raycast seems to undershoot. I have no idea what's causing it to act this way.
I have the c# script attached.
Thanks for your help! I’m looking forward to improving.