[Solved] Spawn object on specific instance of another object

I’m working on a minigolf game and I’m using a lerp camera that follows the ball. I’m hoping to use this to easily get a smooth camera motion between one hole and the start of another.

I have found that I can delete the ball and spawn it elsewhere to get the camera to follow well… but I don’t know how to get it to spawn at a specific instance of my target object. Is it possible to reference a specific copy of an object? Either by instance variable or otherwise?

If you think of a golf course layout, I basically just want to say that if you get it in Hole1, spawn the ball at Start2. If the ball is in Hole2, spawn at Start3. Etc.

Thanks!

1 Like

Use the instance variable as condition to pick it.

1 Like

That would be good, but how do I specify the instance?

I have tried Start.variable(target) for example, but I’m not specifying the instance there still so it tends to put the ball at the coordinates 0,0.

1 Like

assuming, you have multiple Start objects, and want to select the start object with variable target = 1
you use the condition
Start.variable(Target) = 1

then set the position of Newobject to that start object intance
action
Set pos of newobject to start.X() /Start.Y()

1 Like

Perfect, thank you Slash. With this info, I was able to set up a scene variable that increases by one each time I click my Next button or the ball goes in a hole, so now I can easily move from hole to hole!

1 Like