making a grid-based movement system ONLY for a child object
hello, i've got this project in which the player moves around crates and stuff. on key down the player "picks up" the crate (by making it its child and setting the transform to 1 on the y axis) and on key up the crate is detached and placed one unit in front of the player. now the problem: my game is semi-grid like as in all the game objects are placed exactly one unit (or 0.5) from each other and the player's task usually involves placing the crates in specific places. now i wanted to give the player a sort of "assistive(spelling?) crate placing system" to improve user experience (without messing with the player itself). now my thoughts are as follow: i have a crosshair object that will tell the player where the create will land once he releases it, can i somehow have this crosshair object to act as a child, and yet snap to the nearest 0.5 point in world coordinates? if anyone could help me i'd be super thankful and give them 10 cookies, maybe even eleven.
Your answer
![](https://koobas.hobune.stream/wayback/20220612081910im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Prevent local movement of child with Rigidbody? 1 Answer
Is ther a way to base movement translation through the grid map of the tilemap? 1 Answer
Need to make grid movement more smooth 1 Answer
Need help to solve problems with First Person Dungeon Crawler movement script 0 Answers
Grid Movement with Smooth Movement 0 Answers