Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tunahantolga

Pages: [1]
1
Support / Re: Trigger Animation doesn't work, please help me.
« on: July 29, 2013, 03:39:09 pm »
Yeah, animation is working but my not just thing.When gold touched shaman, gold is destroy and working animation.Also animation just as gold working.So animation is move to y axis always.

When gold touched shaman, animation Tk 2d Sprite changes instead of gold.

2
Support / Re: Trigger Animation doesn't work, please help me.
« on: July 29, 2013, 02:06:30 pm »
I take a 2 error.
Firstly : Unable to find clip 'golddestroy' in library,   
secondly : Calling clip.Play() with a null clip.
 

3
Support / Re: Trigger Animation doesn't work, please help me.
« on: July 29, 2013, 12:38:17 pm »
Yep, I take a error. "NullReferenceException:Object reference not set to an instance of an object"

4
Support / Re: Trigger Animation doesn't work, please help me.
« on: July 29, 2013, 12:06:23 pm »
Normally, I am using 2.00 version tk2d but I make a update now. I didn't add Sprite With Animator on screen. Should I add?


5
Support / Trigger Animation doesn't work, please help me.
« on: July 29, 2013, 10:06:09 am »
Hi,

I want to trigger an animation(tk2d Animated Sprite) also I have a shaman and gold on screen.When gold touched a shaman, gold is destroyed but I can't see animation.I want to gold touched a shaman, gold is destroy and "golddestroy" animation.

I take it my shaman object is "goldshaman" tag and animated sprite,shaman and gold  has a sphere collider and trigger is a selected.
I take a one error. Error is a " NullReferenceException: Object reference not set to an instance of an object"

Here is the code:

public class col : MonoBehaviour {

    tk2dAnimatedSprite animSprite;

   // Use this for initialization
   void Start () {

        animSprite = GetComponent<tk2dAnimatedSprite>();
   }
   
   // Update is called once per frame
   void Update () {

       
   }

    void OnTriggerEnter(Collider collision)
    {

        if (collision.gameObject.tag == "goldshaman")
        {

            animSprite.Play("golddestroy");

        }
    }

}

Please help me
Thank you  :)

6
I add a Rigidboy(use gravity and is kinematic) on Gold and Shaman. After solved a problem.

7
Gold has a other C# code. And I changed goldWiggle value and goldSpeed. Example goldWiggle x= 3, y=0, goldSpeed=1.
So gold pass through shaman but gold is not destroy.

Here is the code:

    public Vector3 initPas;
    public Vector2 goldWiggle;
    public float goldSpeed;

   // Use this for initialization
   void Start () {
        initPas = transform.position;
   }
   
   // Update is called once per frame
   void Update () {
        transform.position = initPas + new Vector3(Mathf.PingPong(Time.time * goldSpeed, goldWiggle.x), 0, 0);
   }

8
Support / OnTriggerEnter is not running! Need help with collision.
« on: July 27, 2013, 09:35:40 pm »

0
I am making jumping game and I have a problem.(I am using Unity 4 and 2D Toolkit.) I have a 3 sprite in scene.First layer, second shaman(main character), third gold. I want to collision shaman and gold.When shaman touched gold, I want to destroy gold.

Here is the code:

void OnTriggerEnter(Collider collision) {
 
Destroy(collision.gameObject);
 
if (collision.gameObject.tag == "goldshaman") {
Destroy(gameObject);
}

}

I made a shaman tag is goldshaman and shaman and gold is own to sphere collider. Also is trigger marked.(gold and shaman). Shaman and gold is same z axis.Gold is moving and touched shaman but gold is not destroy.

Simply can't work why?

Please help guys.

9
Support / Re: Acceleration x axis not working
« on: July 25, 2013, 03:50:11 pm »
Thank you! but I have a problem, this is a last question. I want to make a debug on android tablet.Normally is debugging in tablet after I use to 2D Toolkit was not running.

I am using tk2dCamera but scene has got a camera preview and tk2dCamera preview.

10
Support / Acceleration x axis not working
« on: July 25, 2013, 01:41:21 pm »
Hello,

I bought a new Toolkit 2D so I don't know everything.

I am making jumping game and I have a problem.(I am using Unity 4 and 2D Toolkit.) I want to acceleration x axis on character.Normally function is running  in Unity but if I use  2D Toolkit is not running.Character is a sprite.Acceleration code is attached in character.

Here is the code:

    public float speed = -10.0F;
    private Vector3 dir;

       void Update () {

        Vector3 dir = Vector3.zero;
        dir.x = -Input.acceleration.x;
        dir.z = 0;

        if (dir.sqrMagnitude > 1)
            dir.Normalize();

        dir *= Time.deltaTime;

        transform.Translate(dir * speed);

        Debug.Log(dir.x);
}


11
Support / Re: Material.SetTextureOffset function is not working!
« on: July 25, 2013, 11:50:13 am »
Thank you! I will try it.

12
Support / Material.SetTextureOffset function is not working!
« on: July 25, 2013, 11:35:54 am »
Hello,

I am making jumping game and I have a problem.(I am using Unity 4 and 2D Toolkit.) I want to background scroll.Normally function is running  in Unity but if I use  2D Toolkit is not running.

Here is the code:

    public float scroolSpeed = 0.2F;
    public float offset;

 void Update () {
         offset = Time.time * scroolSpeed;
        renderer.material.SetTextureOffset("_MainTex", new Vector3(0, Time.time * scroolSpeed));
   }

simply can't work why? 
Please help guys.

Pages: [1]