Mouse rotation

Hi i am a new programmer and I’ve been following Quill18 and his Simple fps shooter and I’m trying to make sure the character moves with the mouse E.g. looks left hits W goes the way you’re looking, anyway the error is this. Assets/Scripts/PlayerController.cs(24,37): error CS0019: Operator *' cannot be applied to operands of type method group’ and `UnityEngine.Vector3’ anyway i would like to be able to make it myself so i can become a better programmer. Thank you for your help in advanced ,

A useful skill in programming is learning to read error messages. This error message says that you have an error on line 24 character 37 (24, 37) where you are attempting to use * on a method and a Vector3.

Line 24 is

speed = transform.Rotate * speed; 

transform.Rotate is the method and speed is the Vector3. Your code uses Transform.Rotate a few lines higher than 24, for more info on how to use it check out Unity - Scripting API: Transform.Rotate. The error arises because the code doesn’t know how to use * on this method and a vector3.

Most likely you wanted to rotate the “speed” variable by the transform’s rotation. To do this you would use transform.rotation, i.e.

    speed = transform.rotation * speed;