hi. im trying to make it so that my Fps can set his speed stat and that he will move faster with a higher number. I took the Fps that comes with unity and i tryed editing it, but it wont work. Help?
Yes i made sure that Spd in the Stats script is static.
Here’s what i changed in the code
class CharacterMotorMovement {
// The maximum horizontal speed when moving
@System.NonSerialized
var Spd : float = Stats.Spd;
@System.NonSerialized
var maxForwardSpeed : float = Spd;
@System.NonSerialized
var maxSidewaysSpeed : float = Spd;
@System.NonSerialized
var maxBackwardsSpeed : float = Spd*.3;
// 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.
@System.NonSerialized
var maxGroundAcceleration : float = 30.0;
@System.NonSerialized
var maxAirAcceleration : float = 20.0;
// The gravity for the character
var gravity : float = 10.0;
var maxFallSpeed : float = 20.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);
}
If you want to bump your question, edit it or post a comment and try to improve the question. Don't post another question.
– Bunny83