1
I have the following scenario:
The other objects were disabled only to demonstrate the problem. I think that disabling them does not influence the game, right?
See what happens when you click on play
in Unity:
Note that the object Ground
and Ground_2
were changed to the position (0.0) relative to the camera (yes, the pivot of the Sprite is Bottomleft, so it is not centered)
See the configuration of objects in the inspector:
Background
Camera
Camera script
using UnityEngine;
using System.Collections;
public class CameraSettings : MonoBehaviour {
private float targetRatio = 9f/16f;
// Use this for initialization
void Start () {
Camera cam = GetComponent<Camera>();
cam.aspect = targetRatio;
}
}
Ground (the 3 objects are the same, have been duplicated so the attributes in the inspector are equal):
Note that the Ground
, Ground_2
and Ground_3
sane prefab
.
I created an Empty Gameobject (and added Recttransform, Rigidbody2d as the image above) and inside this Gameobject added a Sprite (Groundsprite) with the following settings:
After the above action, I dragged the Gameobject to a Prefab and then removed the Gameobject from the scene, later I dragged the Prefab to the scene 3 times, generating the 3 elements that make up the ground (Ground, Ground_2 and Ground_3) and then went to the menu in "Gameobject > Break Prefab Instance" to be able to edit them without modifying my Prefab.
Yeah, it was a big mess, but I think the problem isn’t that I’m dragging things around, right?
What’s wrong with the game? Can it be program cache? Installation with problem? What will be?
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero