-1

I am a beginner game creator in Unity 2D, I am following this tutorial by Coding in Flow:

https://www.youtube.com/watch?v=UlEE6wjWuCY&list=PLrnPJCHvNZuCVTz6lvhR81nnaf1a-b67U&index=10

(I am having a problem at 11:37 in the video)

My C# script for moving platforms called "Waypoint Follower" is in Moving platform game object, but unlike in the video, the serialized field for the drop down menu is not an array allowing me to drag and drop waypoints, instead it is making a drop down menu called "size" and wants a number input. My code is identical to the script in the video, but it is not having the same results in Unity when I am viewing the Waypoint Follower script in the inspector.

Here is what mine looks like:

My Image

Here is what it is supposed to look like:

Coding in Flow's Image

Why is there no list???

I will love you forever if you can fix this

Also, here is my code in case it's not the same and I'm being stupid:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WaypointFollower : MonoBehaviour
{
    [SerializeField] private GameObject[] waypoints;

    private void Update()
    {
        
    }
}
shiptoast
  • 11
  • 2
  • 1
    Are you sure it's an "Array" and not a "List"? Also it can look like this depending on which Unity version you are using. But you can still add your waypoints, simply set the size that you want and drag and drop your waypoint objects. – Pavlos Mavris Mar 14 '23 at 07:20
  • @PavlosMavris doesn't make a difference .. the Inspector drawer is the same for `T[]` and `List` ... @OP I rather suspect a different Unity version! Your Inspector is from an older Unity version. If I remember correctly the reorderable list as in the second image was introduced as the default drawer in Unity 2020 ... => What version are you using? – derHugo Mar 14 '23 at 07:34
  • And actually this shouldn't make any difference in the usability of the Inspector except .. yes you can't reorder the items – derHugo Mar 14 '23 at 07:36
  • I am using version 2019.4.17f1, thank you @PavlosMavris and derHugo it's working now :) – shiptoast Mar 14 '23 at 20:18

1 Answers1

1

Was a version issue probably, I got it working by just dragging and dropping the waypoints into the script in the inspector and it made a list.

shiptoast
  • 11
  • 2