Changing size of an object

I need to change the size of a game object that is situated in factory object. It is possible to do that?

You can adjust the scale of a game object when you spawn it using factory.create(). Note that there is an issue with collision objects not being scaled.

2 Likes

hey britzl,
I’m very new to programming, I was hoping you could help me out with your responses.
i can see that the factory.create() has multiple optional parameters, how can you change the scale without having to override the properties of the game object.
the factory.create() works if i put nil in some optional parameters, but if i put nil in the properties, nothing will spawn.
basically i dont want to change the default properties of the game object (in this case just a sprite, spawned from a factory), i just want to change the scale.

or is there some way to fetch the orginal properties and just make it equal to some variable and put that into the factory.create() command.

thanks for your help.

Hey Last_Frog!
Check out the api. There’s a scale paramenter that you can work with. Usign the example of the docs:
self.my_created_object = factory.create("#factory", nil, nil, {my_value = 1}, 2.0) -- '2.0' is the new scale
Good luck!

1 Like

Thanks heaps for the reply, but are your not overriding the properties of the game object prototype with for the new game object with ‘{my_value=1}’?

i’m sorry if this is super basic, I have like zero programming experience and somethings that are assumed by people with more experience, just flies over my head.

it was just an example from the api, I only added the final parameter (scale). You can pass an empty table like so {} for the properties.

factory.create("#factory", nil, nil, {}, 2.0)

1 Like

okay thanks heaps