I have the following scenario:
Theotherobjectsweredisabledonlytodemonstratetheproblem.Ithinkthatdisablingthemdoesnotinfluencethegame,right?
Seewhathappenswhenyouclickplay
onUnity:
NotethattheobjectGround
andGround_2
werechangedtoposition(0,0)inrelationtothecamera(yes,thespritepivotisBottomLeft,soitdoesnotstaycentered)
Seetheconfigurationoftheobjectsintheinspector:
Background
Camera
CameraScript
usingUnityEngine;usingSystem.Collections;publicclassCameraSettings:MonoBehaviour{privatefloattargetRatio=9f/16f;//UsethisforinitializationvoidStart(){Cameracam=GetComponent<Camera>();cam.aspect=targetRatio;}}
Ground(the3objectsarethesame,havebeenduplicatedsotheattributesintheinspectorarethesame):
NoticethatGround
,Ground_2
,andGround_3
areprefab
.IcreatedanemptyGameObject(andaddedRectTransform,Rigidbody2Dasabove)andwithinthatGameObjectIaddedasprite(GroundSprite)withthefollowingsettings:
Yes, it was a big mess, but I think the problem is not that it's dragging things around, right?
What's wrong with the game? Can it be program cache? Installation with problem? What will it be?