Seeking advice on implementing stabbing mechanics in my Unity game, inspired by Boneworks

Hello everyone,

I’m currently working on a project that is heavily inspired by the physics-based sandbox game “Boneworks”. I’m trying to add stabbing mechanics to my game, but I’m struggling to figure out how to implement this feature and i don’t want to pay money for a unity asset.

I would really appreciate it if anyone could provide me with some code snippets or suggestions on how to go about adding stabbing mechanics to my game. I have some experience with Unity and C#, but I’m not very familiar with implementing physics-based gameplay mechanics.

My goal is to allow the player to stab objects with a knife or other sharp object. The stabbing should be realistic and dynamic, so the player can stab at different angles and locations on an object, and the object should react appropriately to the stab and the stabber should be able to move in the body.

If anyone has any suggestions or code snippets to share, I would be extremely grateful. Thank you in advance for any help you can provide!

Allow the knife to be parented to a stabbed object / person upon release, and make sure it keeps it’s local position relative to the stabbed object at that point. Unparent the knife if it’s pulled back out. You’ll want separate colliders for the handle and blade so you can turn off the blade’s colliders while it’s entering/exiting. Only make the handle half an interactable. Add whatever VFX you want for blood. Probably would work a lot better for a knife than a katana, I think a long blade would make thing 5x harder unless you liked the no-clip like effect for it. Start with XR Toolkit, or buy something with a lot more alternatives for more advanced physics interactions if that’s the rabbit hole you want to go down. Physics interactions in VR are generally a very complicated and advanced topic. There is a reason Boneworks took so long to get right.

alright thx i see what you mean