Factory creation problems

Hi,

My game is like a simplified game of football, my problem is when a player scores I’m trying to spawn the ball back to the middle of the screen.

I’m trying to do this with the use of factory.create but when I create the factory file it cannot attach itself to the ball prototype.

A solution to this would be great!
Thanks,

Ben



The factory needs to point to a game object (presumably containing a ball sprite and script). Note that this game object needs to be created in the Assets pane on the left. Your factory can’t point to a game object that only exists in the Collection Outline on the right.

2 Likes

Correct. It has to be a .go file on disk. @Defold_Ben you can read more about factory components here:

And there are some examples here:

2 Likes