- Home /
Question by
Alex Strife · May 02, 2013 at 02:00 PM ·
javascripterror
BCE0044 Error - expecting :, found '='
Doing my head in, please help me...am close to punching my computer screen. It's such a simple thing. All I want is a checkbox to store a boolean for gravity, if it's checked then store gravity as 10.0.
class CharacterMotorMovement {
// The maximum horizontal speed when moving
var maxForwardSpeed : float = 10.0;
var maxSidewaysSpeed : float = 10.0;
var maxBackwardsSpeed : float = 10.0;
// Curve for multiplying speed based on slope (negative = downwards)
var slopeSpeedMultiplier : AnimationCurve = AnimationCurve(Keyframe(-90, 1), Keyframe(0, 1), Keyframe(90, 0));
// How fast does the character change speeds? Higher is faster.
var maxGroundAcceleration : float = 30.0;
var maxAirAcceleration : float = 20.0;
var useGravity : boolean;
var gravity : float = 0.0;
var maxFallSpeed : float = 20.0;
if(useGravity){
gravity = 10.0;}
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
// Very handy for organization!
// The last collision flags returned from controller.Move
@System.NonSerialized
var collisionFlags : CollisionFlags;
// We will keep track of the character's current velocity,
@System.NonSerialized
var velocity : Vector3;
// This keeps track of our current velocity while we're not grounded
@System.NonSerialized
var frameVelocity : Vector3 = Vector3.zero;
@System.NonSerialized
var hitPoint : Vector3 = Vector3.zero;
@System.NonSerialized
var lastHitPoint : Vector3 = Vector3(Mathf.Infinity, 0, 0);
}
Comment
If you tell us which line has the problem, perhaps we can help. Remember, the line is the first of the two numbers that the compiler gives you with the error message.
Your answer
![](https://koobas.hobune.stream/wayback/20220613101409im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Error: not a member of 'UnityEngine.GameObject[]'. 2 Answers
beginner question- several errors 1 Answer
Issue with OnTriggerEnter. 1 Answer
expecting (, found 'Update' and unexpected char: 0x200B. 2 Answers
Player not taking any damage 2 Answers