Search Issue Tracker
By Design
Under Consideration for 2021.3.X, 2022.3.X, 2023.1.X, 2023.2.X, 2023.3.X
Votes
0
Found in
2021.3.31f1
2022.3.10f1
2023.1.16f1
2023.2.0b12
2023.3.0a8
Issue ID
UUM-52686
Regression
No
Hexagonal Grid is not returning the correct cell position when using GridLayout.WorldToCell
How to reproduce:
1. Open the user's attached project
2. Enable SampleScene/Root_Launcher/Marker_Position in the Hierarchy window
3. Enter Play Mode
4. Move the mouse around in the Game view
Expected results: The correct cell is highlighted
Actual results: The highlighted cell is in the wrong position
Reproducible with: 2021.3.31f1, 2022.3.10f1, 2023.1.16f1, 2023.2.0b12, 2023.3.0a8
Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested
Notes: Using Rectangle Cell Layout returns the correct position
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
The user is translating the target's World Space position to the corresponding Cell Position of the Hexagonal Grid. This will correctly give the Cell Position on the Hexagonal Grid.
The Cell Position on the Hexagonal Grid is not always equal to its corresponding World Space position in value. The purpose of the Grid is to help translate Cell Positions on the Grid to its corresponding Local and World Space positions and vice versa.
User should instead be translating the target's World Space position to the Grid's Cell Position and then translating the Grid's Cell Position to the Grid's World Space Position for this case, to get the correct rounded position of the Hexagonal cell.