I’d like any easy script with
public GameObject yourObject;
or
public Rigidbody2D yourObject;
to add my prefab which is a GameObject with a sprite renderer, if needed also a Rigidbody2D (Or you have a better idea?)
I want to shoot this prefab everytime i press my button “m_AttackAxisName” in direction of my mouse position.
All i need is a script for velocity or to addForce on a prefab ( so probably have to instantiate? )
Dont forget 2D and compatible with the API of the newest Unity 5.3…
Its ok if you have a script which does not go to mouse position direction, if you got a good working one i could do that alone.
I already tried online solutions but i never can add force or do velocity to INSTANTIATED objects ;(