Nightmare (Unity training day) Part of script not found

Asked

Viewed 57 times

0

inserir a descrição da imagem aquiHello I am configuring the script of "Playermovement" of the project Nightmare of UTD 2014, well, arriving at this part (shown in the photo) I went to configure the script for the player to follow the mouse, however Transform did not find the "position", I followed the tutorial correctly in all the steps, but at this stage of "Playertomouse" could not put "Transform.position",I use Microsoft Visual Studio (updated) Obs: not to mention that the error times when subtracting by floorhit, saying that the "-" is not a valid character. inserir a descrição da imagem aqui

1 answer

0

Your floorHit is a Vector3? If it is not Vector3 you will have to do as follows to decrease in all positions: "Vector3 playerToMouse = new Vector3 (Transform.position.x - floorHit, Transform.position.y - floorHit, Transform.position.z - floorHit)" t minusculo

  • As I said, now I made an error when applying the ''-'' because I can’t apply it to the ''float', and in the raycasthit, to half-lost ;-; http://imgur.com/WEcvkoN

  • Try to turn your raycasthit into a float if I’m not mistaken you can do so ' float x = floorHit(float)';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.