#Calculate the original position ??

1 messages · Page 1 of 1 (latest)

safe raptor
#

so i have this vars
public transform SpawnPoint;
public float spacing;

and i spawn tile like this on spawn point (look at the pic)

and i want to move back tiles to their original pos based on spawn point
tile.transform.DOMove(new Vector3(tile.transform.position.x / spacing, 0, tile.transform.position.z / spacing), 1);
i know its wrong but i didn't know how do it any help ?

hallow orbit
#

and also, what does happen here?

#

oh I think I see your issue anyway

#

you should only be multiplying i and j by spacing

#

not the base position

flint mountain
#

LocalPosition means that you set the position relative to the parent position. So delete the last line of code(title.transform...). outside of the for loop then store the spawn position in a variable and then assign it to the title position in the for loop

hallow orbit