Hello! First at all thanks for your time and help.
Let me try explain my problem. I created a very rudimentary script to place items. And now I want to move them.
But that movement isn’t between two points exactly, it is in a direction. For example if the user choose “North” the movement will be to “South”, if he choose “NorthWest” movement will be to “SouthEast”. For those cardinals points I created two empty GameObjects that I place in the “Start” in a particular place:
Thanks so much Joe Strout, again you are helping me alot. I was able to continuing trying things thanks to you.
In this case I was able to use the “coordinates” that I did for the direction and to keep my items moving indefinitly.
Now I am trying to calculate distance (between the item starting point and a radius) and destroy it when reach it. Still need alot work, but first I want try it by myself
For checking distance you could use the following.
Update()
{
// Dest - our position = the vector from us to them. Then use
// magnitude to get the 'length' of that vector line.
float dist = Vector3.Magnitude(target.transform.position - transform.position);
if(dist >= ourKillLimit)
Destroy(this.gameObject);
}
You could have this on your moving objects (if I understand your idea properly) and target will be what it’s checking against. ourKillLimit is what ever float you want to set the distance too.
Hope that actually makes sense… I’m trying a new shorter post style…