Hi, I have this game and an enemy is supposed to charge (Like a bull) at my Player and throw him in the direction the bull charges, but, I cant seem to manage …
So it does not do anything to player?
Are you sure myRigidBody is the player?
If the player is facing the elk then forward would move the player into the elk.
You could check elk’s velocity at the time but that might fail you as it collides with the player’s collider and stops but you could store the elk’s movement direction in a number of ways then use that to find how you should apply force.
Ensure myRigidBody is in fact your player’s rigidbody.
Have to put logs in where you are applying the pushback force to make sure you are in fact getting there.
Then when you know you are applying force you would have to apply force based on the elk’s facing, for instance if the elk’s velocity on the x axis is positive that would mean the player’s applied force x is negative or vice versa as per your example; and added force on the y axis to get the lift you want. I would imagine as well that it would be a one time application of force that would have to negate any force by that elk for a duration and likely should count as a hit by the elk to inform it to stop and rethink what to do next.