Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Help with Error Code CS0019

$
0
0
So this code is from my character controller script on line 34. private ControllerParameters2D Parameters { get { return _overrideParameters ?? DefaultParameters; } } I'm getting a Error Code CS0019, stating, "Operator '??' cannot be applied to operands of type 'ControllerParameters2D' and 'ControllersParameters2D'" I know this is also referring to the ControllerParameters2D script I made. The code is here below: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] public class ControllersParameters2D { public enum JumpBehavior { CanJumpOnGround, CanJumpAnywhere, CantJump } public Vector2 MaxVelocity = new Vector2(float.MaxValue, float.MaxValue); [Range(0, 90)] public float SlopeLimit = 30; public float Gravity = -25f; public JumpBehavior JumpRestrictions; public float JumpFrequency = .25f; } I'm very new to C# coding. I even copied this from the 9th video of the Creating a 2D Game in Unity 4.5 tutorial at Udemy. I know this code was originally for an older version of Unity and since I'm using Unity 5.6.1f1, I'm sure that some of the code is incompatible with the newer version. Please help me and explain to me in depth the logic behind it.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>