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 - FarzanZand

Pages: [1]
1
Support / Re: Creating a parallax background with orthographic view.
« on: August 13, 2013, 10:30:35 am »
Cheers! :)
I sent in my request.

2
Support / Re: Creating a parallax background with orthographic view.
« on: August 13, 2013, 10:22:16 am »
Thanks Unikron, I'll check it out right away.

The link you placed did not work though. I get this message ""The topic or board you are looking for appears to be either missing or off limits to you.".

3
Support / Creating a parallax background with orthographic view.
« on: August 13, 2013, 09:53:39 am »
Hi again, I am working on creating a parallax background where different layers move in different speeds. At first, I figured I'd just use two cameras, one orthographic and one perspective but I can't get the game view to show both. It either only shows one or the other.

Checking around these forums I saw you recommend to people to check this link that shows how parallax scrolling in 2dTk can be done, but I can't access it and I get the error message "The topic or board you are looking for appears to be either missing or off limits to you."

http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,87.0.html

Can you point to the right direction so I can get the parallax background up and running? It is a 2d platformer game, and main camera is the orthographic 2dtk camera.

Best regards
Farzan

4
Support / Re: Flipping sprite animation for moving other direction.
« on: August 12, 2013, 05:00:55 pm »
Thank you!!!
It works perfectly now! Oh this is such a relief, and such a silly mistake to be stuck on for five hours.

You just made my day. :)

5
Support / Re: Flipping sprite animation for moving other direction.
« on: August 12, 2013, 04:49:42 pm »
To the playerobject, that holds the sprite for the player I am controlling.

I created a sprite with animator, and added the sprite animations that I have created to it, and the animationscript I am using which is attached above.

6
Support / Re: Flipping sprite animation for moving other direction.
« on: August 12, 2013, 04:11:52 pm »
I have tried everything I can think of to flip the sprite. Just tried.


private tk2dBaseSprite xFlip;
xFlip = GetComponent<tk2dBaseSprite>();

xFlip.FlipX(); 

This did not work either. :(

7
Support / Flipping sprite animation for moving other direction.
« on: August 12, 2013, 01:43:15 pm »
Hi there!
Figured I would ask for support here instead of the unity forum, just incase someone with the same problem might do a search for flipping. My searches did give some hits, but none that I could personally use because they were above my level.

I have an animation of a sprite for when he walks to the right. What I want is for it to be flipped when I walk to the left, but I can't seem to get it to work. I tried flipX and other recommendations but I am doing them completely wrong since they won't work. Could you explain to me how to flip them for when I do something in reverse direction and then add the line/lines in my code as it should be? I learn best by seeing how it is done and copying it. I have added my code as far as I have gotten here below. I have also tried adding sprite.scale but I must be missing something.

I understand that I can scale the x to -1, but I can't reach it by code. This line doesn't work. :( gameObject.sprite.scale = new Vector3(-1,gameObject.transform.position.y, 0);

Code: [Select]
using UnityEngine;
using System.Collections;

public class Animations : MonoBehaviour {

//private bool walking = false;

private tk2dSpriteAnimator anim;
// Use this for initialization
void Start () {
anim = GetComponent<tk2dSpriteAnimator>();
}


//Go back to idle when nothing is pressed.
    void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
{
anim.Play ("idle");
}

// Update is called once per frame
void Update () {

if (Input.GetKey(KeyCode.D))
{
anim.Play("walk");
anim.AnimationCompleted = HitCompleteDelegate;
}

if (Input.GetKey (KeyCode.A))
{
anim.Play("walk"); //I want the sprite play walk flipped. I tried adding sprite.scale *= (-1,1,1); here, but did not work.
anim.AnimationCompleted = HitCompleteDelegate;
}
}
}



Best regards,

Farzan Zand

Pages: [1]