Hey Guys
Its the Ultimate Newb again.
I fixed up my scripts and got my character IDLE and WALING Animation ststes working using conditions. ALL GOOD.
My issue now after editing my code a heap and losing all the old code, (because i didn’t realize when i debug monodevelop opens all scrips and i ended up editing my working original accidently. Now a mess. Oh well its good learning. Im stuck with my movement2.cs Script.
Here is the code
using UnityEngine;
using System.Collections;
public class Movement2 : MonoBehaviour
{
//Myline for adjusting the clouds layer to keyb to smoothen from parallax effects
public GameObject cloudlayer;
public float cloudoffset;
public float TrumpWalkSpeed;
public bool FacingRight = true;
public float TrumpDirection;
public GameObject trump; //Trump the man
public Animator anim; //Trump Animation Componant
void start()
{
anim = GetComponent(); //Get the Animator and make it “Anim”
Debug.Log(“start”);
anim.SetInteger(“MovementType”, 0); //Idle Animator Start of game Trump is IDLE
}
void Update()
{
anim.SetInteger(“MovementType”, 0); //Idle Animator - Assume always idle unless key is pressed
Debug.Log(“Update”);
}
void Direction()
{
Debug.Log(“Direction”);
float TrumpDirection = Input.GetAxis(“Vertical”);
if (TrumpDirection > 0 && !FacingRight)
{
flip();
}
else if (TrumpDirection < 0 && FacingRight)
{
flip();
}
}
void flip()
{
Debug.Log(“flip”);
FacingRight = !FacingRight; //Flip
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
void move()
{
transform.Translate(Vector2.right*TrumpDirection * (TrumpWalkSpeed + cloudoffset) * Time.deltaTime);
Debug.Log(“move”);
}
}
As you can see i made a hell of a lot of Debug notes and i get none of them come up. Its like my script doesn’t run at all, but the game loads no errors? Almost like i have no input. I have applied the Script to the gameobject
I’ve checked project settings and Vertical/Horizontal mappings. Made sure the Name of the Script Match.
Any ideas or even suggestions as this code u can clearly tell its NEWBie
