- Home /
Traffic transport system in 3D space
Hey, guys,
I'm trying to figure out how to create a traffic transport system in space (3D). My current version instantiates random spaceships flying and delivering from one space station to another. At a certain distance to the player the 3D model is hidden and only the script continues. The script for each spaceship is called via an update function in a different class via a foreach loop to move from A to B. Unfortunately the FPS rate goes down quickly with a relatively small number of ships.
What good algorithm structures are there for such processes?
Since the ships are basically invisible, you could update only few of the each frame. They would make bigger "jumps" between each movement, but it doesn't really matter since player cannot see them.
$$anonymous$$aybe there are even calculations that could be skipped entirely. Something like ship rotation, this should only be calculated when ship is visible.
Also I'm not sure how Unity handles it, but don't update transform components for invisible ships. Calculate everything on a Vector3 array and only move the ship once, when it becomes visible
If you share the code with us, we can try to see if more smart alghoritms can be implemented
Your answer
Follow this Question
Related Questions
How to snap a Prefab to the normal of an irregular mesh 1 Answer
How to animate gun and character if they are different gameobjects? 0 Answers
Character moving in the wrong direction, glitched Rigidbody? 1 Answer
Grid Based Movement Raycast Issue - Please Help,Raycast Not Working After Roating - Please Help! 0 Answers
How to show a 2D texture through a 3D object like it's a portal? 1 Answer