Hi all, I'm experimenting with player flipping and I am going through the documentation here Spine-Unity Runtime Documentation.
Now I worked out how to get the correct libraries on my code but straight a way I have run into a problem using SkeletonAnimation.
if (Input.GetKey (KeyCode.A)) {
GetComponent<Rigidbody2D> ().velocity = new Vector2 (-moveSpeed, GetComponent<Rigidbody2D> ().velocity.y);
}
player1.SetFloat ("Speed", Mathf.Abs (GetComponent<Rigidbody2D> ().velocity.x));
if (GetComponent<Rigidbody2D> ().velocity.x > 0)
//transform.localScale = new Vector3 (0.2f, 0.2f, -0.2f);
//GetComponent<SpriteRenderer>().flipX = true;
//skeletonAnimation.Skeleton.FlipX = true;
SkeletonAnimation.skeleton.FlipX = true;
else if (GetComponent<Rigidbody2D> ().velocity.x < 0)
//transform.localScale = new Vector3 (-0.2f, 0.2f, 0.2f);
//GetComponent<SpriteRenderer>().flipX = false;
SkeletonAnimation.skeleton.FlipX = false;
}
It gives the following error when I put this in.
Assets/PlayerController.cs(56,43): error CS0120: An object reference is required to access non-static member `Spine.Unity.SkeletonRenderer.skeleton'
So assuming I just need to give the code a gameobject to look for how do I do this? "gameObject" and other variants don't seem to work.