Quantcast
Viewing latest article 3
Browse Latest Browse All 18

StackOverflowException due to transform.position

The error: StackOverflowException UnityEngine.Transform.get_position () (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:19) Tilemap.getG (.TileUnit baseTile, .TileUnit tile) (at Assets/Scripts/Tilemap.cs:331) The function: float getG(TileUnit baseTile, TileUnit tile) { float valX, valY; float baseX,baseY,objX,objY; GameObject objBase = baseTile.getGameObject(); GameObject obj = tile.getGameObject(); baseX = objBase.transform.position.x; baseY = objBase.transform.position.y; objX = obj.transform.position.x; objY = obj.transform.position.y; valX = Mathf.Ceil(Mathf.Abs(baseX - objX)); valY = Mathf.Ceil(Mathf.Abs(baseY - objY)); return Mathf.Sqrt(Mathf.Abs(valX) + Mathf.Abs(valX)); } Any suggestions or idea as to why this is happening?

Viewing latest article 3
Browse Latest Browse All 18

Trending Articles