Quantcast
Channel: Latest Questions by gopics
Viewing all articles
Browse latest Browse all 48

is there any possible to use two transform.rotate function for same gameobject??

$
0
0
hai guys.....am trying to move a vehicle based on velocity in the terrain which includes ups and down....am using transform.rotate function in 2 different areas for different purpose.....one is float turn=input.getAxix("Horizontal")*300*time.deltatime; curDirection=(curDirection+turn)%360; transform.rotation(0,curDirection,0); its for vehicle orientation adjustment when car is in ups and down.....another one is for vehicle movement i,e left and right ...that code is if(input.getGetkey(keycode.leftArrow)) transform.rotate(vector3.up*time.deltaTime*-rotationSpeed); if(input.getGetkey(keycode.rightArrow)) transform.rotate(vector3.up*time.deltaTime*rotationSpeed); when am try to move a car in left side it doesnt take my currnt if condition i,e when am pressing left arrow that line doesnt executed....what can i do..is there any possible solution to use 2 differnt rotation function for same car object without affection each other......thanks in advance....please ignore cases.....

Viewing all articles
Browse latest Browse all 48

Trending Articles



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