I have this script that I got out of the 2D Lerpz tutorial, —>
var canControl = true;
var spawnPoint : Transform;
class PlatformerControllerMovement {
var walkSpeed = 6.0;
var runSpeed = 10.0;
var inAirControlAcceleration = 1.0;
var gravity = 60.0;
var maxFallSpeed = 20.0;
var speedSmoothing = 5.0;
var rotationSmoothing = 10.0;
@System.NonSerialized
var direction = Vector3.zero;
@System.NonSerialized
var verticalSpeed = 0.0;
@System.NonSerialized
var speed = 0.0;
@System.NonSerialized
var isMoving = false;
@System.NonSerialized
var collisionFlags : CollisionFlags;
@System.NonSerialized
var velocity : Vector3;
@System.NonSerialized
var inAirVelocity = Vector3.zero;
@System.NonSerialized
var hangTime = 0.0;
}
As of right now it works really well, but it isn’t exactly what I would like. This script makes my character move every time I press the left/right arrow keys, but I would like it to automatically start moving my character along x axis as soon as my game starts. But I can’t for the life of me make sence of this script. Where should I add/change a line of code? Thanks for the help!
-Rov