Quantcast
Channel: Questions in topic: "write-my-code"
Viewing all articles
Browse latest Browse all 92

Manipulate gameobjects, pick up & rotate

$
0
0
I am planning to have a gameobject that can be picked up by a mouse click and when the mouse is released, the object will fall. Also, i want to manipulate the object by pressing a key (X) to rotate the object clockwise (on the Z axis) with a changeable speed in the inspector. So far in the script i have set the axis as it is a 2d game function Update() { var v = Input.GetAxisRaw("Vertical"); // v = -1 for down and +1 for up var h = Input.GetAxisRaw("Horizontal"); // h = -1 for left and +1 for right input if ( Input.GetKeyDown("X") ) { //rotate } Many thanks

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>