Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Lighting issues with Spine

Discussion in '2D' started by NahuGuzmy, Aug 7, 2016.

  1. NahuGuzmy

    NahuGuzmy

    Joined:
    Aug 15, 2015
    Posts:
    14
    Hi! i have a little problem with illumination in my Spine character. The image talk by her self



    Here is the code that move the character

    Code (CSharp):
    1. using System.Collections;
    2. using Spine;
    3. using Spine.Unity;
    4. public class Control : MonoBehaviour {
    5.     public float speed = 5;
    6.     public Transform graphics;
    7.     public SkeletonAnimation skeletonAnim;
    8.     private float x;
    9.     private string currentAnimation = "";
    10.     void Update ()
    11.     {
    12.         x = Input.GetAxis ("Horizontal") * speed;
    13.         if (x > 0) {
    14.             graphics.localRotation = Quaternion.Euler (0, 0, 0);
    15.             setAnimation ("Caminar", true);
    16.             skeletonAnim.timeScale = 0.9f;
    17.         }
    18.         else if (x < 0)
    19.         {
    20.             graphics.localRotation = Quaternion.Euler (0, 180, 0);
    21.             setAnimation ("Caminar", true);
    22.             skeletonAnim.timeScale = 0.9f;
    23.         }
    24.         else
    25.         {
    26.             setAnimation("Idle",true);
    27.             skeletonAnim.timeScale = 0.25f;
    28.         }
    29.          
    30.     }
    31.     void setAnimation(string name, bool loop)
    32.     {
    33.         if(name == currentAnimation)
    34.             return;
    35.      
    36.         skeletonAnim.state.SetAnimation(0,name,loop);
    37.         currentAnimation = name;
    38.     }
    39.     void FixedUpdate ()
    40.     {
    41.         GetComponent<Rigidbody2D> ().velocity = new Vector2 (x, GetComponent<Rigidbody2D> ().velocity.y);
    42.     }
    43. }
    44.  
    Thanks!
     
  2. NahuGuzmy

    NahuGuzmy

    Joined:
    Aug 15, 2015
    Posts:
    14
    Sry, i make two posts, my bad