- Home /
Question by
CaileyMB · Mar 06, 2021 at 02:00 PM ·
mouseturningturn based
I need help in turning an image,How to make an image turn
I'm new at Unity so I don't know how I would turn an image with the mouse wheel. I want it to turn the y to where the x is. The project I'm doing is picking up(with mouse) a 2d item in a 3d space and then turning the image left and right with a mouse wheel. This is what I have: public CharacterController turning;
bool turnRight = false;
bool turnLeft = false;
Vector3 playerTurn;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown("Mouse ScrollWheel Right"))
{
turnRight = true;
playerTurn.Set(0, 0, 0);
}
if (Input.GetKeyDown("Mouse ScrollWheel Left"))
{
turnLeft = true;
}
}
void FixedUpdate()
{
turning.Move(playerTurn);
},For a project I'm doing, there are items in the game that you can pick up and move however I also want to the image to turn. as in the Y is in the position that the X used to be in. THis is in Unity and this is what I have so far:
*public CharacterController turning; bool turnRight = false; bool turnLeft = false; Vector3 playerTurn; // Start is called before the first frame update void Start() {
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown("Mouse ScrollWheel Right"))
{
turnRight = true;
playerTurn.Set(0, 0, 0);
}
if (Input.GetKeyDown("Mouse ScrollWheel Left"))
{
turnLeft = true;
}
}
void FixedUpdate()
{
turning.Move(playerTurn);
}*
I'm new a Unity.
Comment
Your answer
Follow this Question
Related Questions
Mecanim "turnonspot" with mouse and not WASD 1 Answer
Turning animation using mouse value 0 Answers
How do I disable mouse to turning right 0 Answers