I dont know how to explain what im trying to do.
So watch this…
m9eb4h
Basically a limit to that list.
I made it work before, but i played with anchors and now its bugged.
When i click play it teleports everything to the wrong position ( first problem )
The limit is not set properly even though the position in the script coresponds to the one in the scene ( second problem )
After i quit play mode the list teleports to -100 ( third problem )
using UnityEngine;
public class Shop : MonoBehaviour
{
public GameObject contentGetWithCoins;
Vector3 leftLimit = new Vector3(0, 27.5f, 0);
Vector3 rightLimit = new Vector3(-175, 27.5f, 0);
void Update()
{
// Swipe Limit ( LEFT , RIGHT )
if (contentGetWithCoins.transform.position.x > 0)
{
contentGetWithCoins.transform.position = leftLimit;
}
if (contentGetWithCoins.transform.position.x < -175)
{
contentGetWithCoins.transform.position = rightLimit;
}
}
}
The script is attached to a game object inside a group of elements named “Misc”, with the position set to 0 0 0. But i dont think it causes that.
I am lost and brain is dead right now.
Btw sorry if its a stupid mistake is my 2nd week in unity.