#arrays

1 messages · Page 1 of 1 (latest)

pearl root
#

I'm fairly certain Arrays don't change at runtime

twilit bobcat
#

what about Lists?

pearl root
#

the length and contents of a list can be changed at runtime yes

tranquil siren
#

Array size doesn't change

#

you can change the contents

twilit bobcat
#

if thats the case I'm using lists to store my boxes
[SerializeField] private List<GameObject> CarriedBoxes = new List<GameObject>();

#

the physics work but i can't change it's position in runtime

twilit bobcat
#

give me a minute to record a video

twilit bobcat
# pearl root why not?

I think i found the problem.
the box transform doesn't respond to to this when i change it in the editor LatestestAddedBox.transform.position = new Vector3(BalanceVelocity.x, BalanceVelocity.y, BalanceVelocity.z);

#

It might have something to do with this error

pearl root
#

seems like you're setting the velocity to the position? Usually with velocity you ADD it to the position

#

maybe a += would be better in this case

pearl root
twilit bobcat
#

yes it is