GameObject在正变换时正确面对,但只要它击中负数就会翻转并面向错误的方式。
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (currentWaypoint),
rotationspeed * Time.smoothDeltaTime);
transform.position = Vector3.MoveTowards(transform.position,currentWaypoint,speed * Time.deltaTime);
Debug.Log (currentWaypoint);
它开始像下面的日志一样翻转:
(1.5,0.0,0.0)UnityEngine.Debug:Log(Object) c__Iterator0:MoveNext()(在Assets / Scripts / Enemy.cs:71)
( - 0.5,0.0,-1.0)UnityEngine.Debug:Log(Object) c__Iterator0:MoveNext()(在Assets / Scripts / Enemy.cs:71)
我希望有人能够用这个
指出我正确的方向答案 0 :(得分:0)
您可以使用带旋转功能的Vector3属性旋转角色, 为速度控制设置变量,然后设置输入功能以控制旋转,如下所示。
Error:(18, 11) type mismatch;
found : akka.http.scaladsl.server.Route
(which expands to) akka.http.scaladsl.server.RequestContext => scala.concurrent.Future[akka.http.scaladsl.server.RouteResult]
required: String => (akka.http.scaladsl.server.RequestContext => scala.concurrent.Future[akka.http.scaladsl.server.RouteResult])
get {