I'm making a sandbox model railroading game where the player can place different track sections to design their own track plan. I attached the 'Remember Transform" script but only the first instance of a track section is actually saved. Here's the instantiation code:
if (Input.GetMouseButtonUp(1))
{
Vector2 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
trackStraightHolder = Instantiate(trackStraightPrefab, worldPosition, Quaternion.identity);
trackStraightPlaced.Add(trackStraightHolder);
}
See link for images...
Thank you!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @shastice.
You'll need to call the RememberTransform script's OnSpawn function if you're spawning such an object through code, as opposed to the "Object: Add or remove" Action.
Try this:
Easy fix...Right on. The prompt response is much appreciated. Thank you!