Hi all. So here is the code in C# and i get errors when trying to add Vector3 direction to list:
List<Object> arr;
void DrawRoute(Vector3 direction) {
if(step == 0) {
tempPos = tempPos + direction;
arr.Add(direction);
step++;
}
else {
tempPos = tempPos + direction;
arr.Add(direction);
step++;
}
}
It works perfectly in JS, but somehow none of the methods from google worked in c# and i can’t even compile it, because it throws errors. If i change list type to Vector3 it works, but i need to store different type of variables in it and it works in JS with “Object” type, so any help would be appreciated. I get following errors:
CS1503: Argument '#1' cannot convert 'UnityEngine.Vector3' expression to type 'UnityEngine.Object'
and
CS1502: The best overloaded method match for 'System.Collections.Generic .List.Add(UnityEngine.Object)' has some invalid arguments