The question is answered, right answer was accepted
[SOLVED] problem with skyboxes in unity 2017
Hello everybody, Im trying to recreate Flammie from Secret of Mana (the 2D version) in Unity 2017. I have all the functionality done, but I'm struggling with the skybox. I have a specific image that I would like to use, but when I follow many of the videos on youtube on how to do it, it looks very bad.
Im using the image shown ono top that can be found in this game maker studio project. The video is less than a minute long, so its not a big time waster. https://www.youtube.com/watch?v=ysUUa7tPslY
Thanks for your help
Answer by OtreX · May 11, 2018 at 10:58 AM
I found the solution.
it was just a problem of the new hierarchy(?) of getting the components.
The texture type of the image that you want to scroll must be set as default and the wrap mode must be set as repeat. Then you must create a quad and attach the image to it. Then attach a c# script to the quad that looks like this.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BackgroundScrolling : MonoBehaviour {
public float speedX;
public float speedY;
private Renderer myRenderer;
// Use this for initialization
void Start ()
{
myRenderer = this.GetComponent<Renderer> ();
}
// Update is called once per frame
void Update ()
{
Vector2 offset = new Vector2 (Time.time * speedX, Time.time * speedY);
myRenderer.material.mainTextureOffset = offset;
}
}
Answer by tormentoarmagedoom · May 09, 2018 at 07:38 AM
Good day.
If you are making a 2D game, you don't need a skybox! Just need a backgroud image for the camera.
You need you camera to
Projection : Ortographic Clear Flags : (Anything except skybox)
And then put a sprite image in background...
Skybox is think for prespective 3D games
Bye!
I thought about that, but I am actually doing 3D with 2D graphics (sprites). Actually, I thought about doing a Quad with a scrolling image/texture (like in this video https://www.youtube.com/watch?v=HrDxn$$anonymous$$I7pCc&t=85s check from 4:50 to 5:10) and the difference would be that the Quad would be always on front of the camera. The thing is that now in Unity2017, the solution seems to be something in the lines of duplicating the image that you want to scroll and change the transform (like in this video https://www.youtube.com/watch?v=IgZQjGyB9zg just check the first 5 seconds).
Any ideas?
Thanks for your time @tormentoarmagedoom :)
Follow this Question
Related Questions
360 video rendering sideways 0 Answers
Rotate skybox with player 0 Answers
Sun gradient looks different on an iPad? 0 Answers
Skybox Shader is shaking 0 Answers