Closed kodokoto closed 11 months ago
We could build a very basic "Auto Moving" system (An interface), that references some object
, and a path
(an array of points). In Start()
it will move the object to the first point in path
. Then in Update()
, it will move the object towards the next point, at a given speed
.
Some extra features would be:
Awake()
perform a RayCast from each path point to the next and assert that there are no solid objects between each point. (or for our case I think a SphereCast
that has a diameter the size of the object might be better) isMoving
member that dictates whether the object moves or not.GetNextPathPoint()
, GetCurrentPathPoint()
, GetPath()
, void SetMovement(bool isMoving)
.
Moving platforms should be implemented.
I think the most interesting way to do this would be to implement a "rail" (a line) that has a platform, centered within that rail and moves alongside it.
This way the movement and direction of the platform are dictated entirely by the rail (which is placed when building levels), and we don't have to worry about hardcoding specific platforms (i.e. up-down platform, left-right platform).
The platform itself should run through the rail at its centre, where its position follows the rail, and its rotation should always be at a horizontal angle.