This question was
closed Mar 30, 2019 at 07:39 PM by
coolerinc for the following reason:
The question is answered, right answer was accepted
Question by
coolerinc · Mar 27, 2019 at 07:12 PM ·
gameobjectparenttransform.positioncursorwaypoint
Why transform.localPosition is incorrect on mobile?
Hi,
I got a cursor prefab in hierarchy and waypoints. Everything works fine in Editor but on mobile the cursor's position is incorrect and jumps like on screenshot. I tried different ways to copy the waypoint's transform position to cursor with no luck.
_mapCursor.transform.localPosition = allChildren[GetCurrentLevel() - 1].transform.localPosition;
_mapCursor.transform.SetPositionAndRotation(allChildren[GetCurrentLevel() - 1].transform.localPosition,Quaternion.identity);
_mapCursor.transform.SetParent(allChildren[GetCurrentLevel() - 1].transform);
I checked the coordinates via Lunar Console and it seemed to be ok
Any idea what's wrong or I missed?
transformpos.jpg
(101.7 kB)
Comment
Best Answer
Answer by coolerinc · Mar 30, 2019 at 07:39 PM
I found the solution by marking active waypoint and checking it before setup cursor. But it's weird that previous attempt was so different on mobile comparing to Editor