[Solved]How do i use the local axis on of child on parent?

I have a problem with a weapon in a 2D game I’m working with. The weapon do of course have recoil, and the recoil is in the opposite direction relative to where the weapon is pointing. This means that the recoil is local to the weapon which is a child of the player. The problem is that the weapon do not have a rigidbody and therefore i can’t addforce to it and must addforce to the parent instead, but how can i addforce the weapons local x-axis on the parent’s rigidbody?

To Turn a Vector3 from local space of one object to local space of another object.

First turn it into World space

Vector3 worldSpace=ObjChild.transform.TransformVector(ls);

Then turn it into local space of the other object

Vector3 ls2=ObjParent.transform.InverseTransformVector(worldSpace);

transform.position, transform.rotation returns the world position and rotation in world space. So you could just use that to calculate the recoil direction. Then you can apply the force in that direction to the parent’s rigidbody.