Updating physics on object in Free dirty girls in cam
Generally, that is a more appropriate technique for Games than pure Object Orientation, and for particle systems it's a must. If all your objects need the same kind of updates there's no other way than to update each one individually.
That unless you can find a way to share data between those object. Why do you have so many objects in the first place? I use a totally different approach with some games- I have a central 'task queue', and every single object adds an 'update me' task to that queue when it's created, specifying when it should happen.
Would you do this by tracking the distance between player and object, and then encapsulating the behavior in two different functions? They're the go to option for optimizing collision, updates, rendering, etc. Basically it's just a really quick collision check, so only the things in your current vicinity will load.
It won't make things go any faster when you have a lot of objects on screen, but the objects off screen will have a VERY low impact on performance.
At the end of the day you're not creating a virtual world, you're creating the illusion of a virtual world...
just do as much work as is necessary to sell it to the player. If you have a very large world, where most of it is off screen, look into quad trees.
Instead of an Array of Objects, you can use a big Object with Arrays for the fields of all instances.
The Object has one update method which updates all its values.
I believe skyrims NPC/etc are motionless or not even spawned until you get within a certain distance of them.
While hes within a certain radius of the player, he will follow the waypoints for his schedule, going indoors, to the tavern, etc etc, but while the player is away, he doesnt exist.
There are many causes for objects to stutter when being moved in Unity.
Otherwise when the frame rate of the game changes, the speed of the objects will also change!
Unity has a variable named delta Time Note: Using only delta Time alone may still give stutter at lower framerates or at higher movement speeds.
It's a bit of a conceptual leap with some things- I don't think about 'how many pixels should I move each frame', it's 'how much time needs to pass before I move one pixel'.