How can you update a prefabs position values live if it is already in game view?
For example, if i have a prefab of a cube and its XYZ position values are all set at 1. And if i place that prefab into the scene view, but its position values are being set all at 5 and its following way points. If i spawn an object into the game(via mouse click) and i want it to follow that cube, it will always go to the prefab coor'ds, meaning 1. How can i change that value so the cude will actually move towards it?
Here is what i am doing at the moment:
var target : Transform;
var smooth = 5.0;
transform.position = Vector3.Lerp(transform.position, target.position, Time.deltaTime * smooth);
Explanation: When my Player gameObject hits an enemy collider (which is bigger than the enemy gameObject) this script will be activated so a prefab(which is just a square at the moment) will 'fire' at the enemy target to destroy it.