Since you guided me how to help make my project better, I can only return the favour.
Currently in Chicken Catch it seems like the mouse position in my operating system is not the same as the cursor in the game e.g. the location of the Chicken. It might be a bit better UX if the speed of the moving chicken (position) would be the same, or to speak more clearly:
private float leftBound; // the most left you want on X axis
private float rightBound; // the most right you want on X axis
...and then in Update something like UpdatePosition() ...
if (mouse.position.x < leftBound){
chicken.position.x = leftBound;
}
if (mouse.position.x > rightBound){
chicken.position.x = rightBound;
}
else {chicken.position.x = mouse.position.x;}
Hope this feedback helped. If you try it out, let me know if you like it better that way.
This is a really good idea! Thanks! The implementation contains some nuances:
Input.mousePosition return pixel coordinates. It needs to be converted to virtual coordinates.
// Moving player to left and right
void MovePlayer()
{
// Get mouse position in pixel-coordinate system and transform it to virtual-coordinate system
Ray mouseRay = camera.ScreenPointToRay(Input.mousePosition);
mouseX = mouseRay.GetPoint(10f).x;
if (gameManager.isGameActive)
{
if (mouseX < leftBound)
{
positionX = leftBound;
}
else if (mouseX > rightBound)
{
positionX = rightBound;
}
else
{
positionX = mouseX;
}
playerRb.MovePosition(new Vector3(positionX, playerPosY, playerPosZ));
}
}
← Return to game
Comments
Log in with itch.io to leave a comment.
Great job there. Seems like we're the only ones who posted stuff to itch.io with the #create-with-code tag :)
Thanks. Indeed we are the only ones)
Since you guided me how to help make my project better, I can only return the favour.
Currently in Chicken Catch it seems like the mouse position in my operating system is not the same as the cursor in the game e.g. the location of the Chicken. It might be a bit better UX if the speed of the moving chicken (position) would be the same, or to speak more clearly:
Hope this feedback helped. If you try it out, let me know if you like it better that way.
This is a really good idea! Thanks!
The implementation contains some nuances:
Input.mousePosition return pixel coordinates. It needs to be converted to virtual coordinates.
The project has updated. You can test it.
Added a link to you in devlog ;)