unity3d 摇杆怎么控制飞行摇杆震动?

&>&&>&&>&正文
战争雷霆飞行摇杆操控指南 摇杆飞行操作技巧
10:09:43 来源:战争雷霆吧 作者:ycy 编辑:苍梧君 浏览:loading
  相信很多初次体验摇杆飞行的玩家都会觉得摇杆操控真的是超难,没关系,小编今天给大家带来的这个教程,可以帮你提升操控技巧哦。
  俗话说的好,不作死就不会死!我相信很多初次体验摇杆飞行的玩家都对这句话深有体会。看到贴吧上很多新入坑的玩家在抱怨摇杆极难操控,看来本菜也只好挺身而出为大家贡献一点用摇杆的体会,来挽救那些已经作死的新杆子们如何绝处逢生!(如果你不想放弃你的摇杆,就请看完吧)
  说明下,本人也就是杆龄4年的玩家,完全称不上老鸟,但是这四年也是从一窍不通的新手过来了,现在主玩美系,英系用摇杆玩街机拿到过2次天神下凡。我个人认为,喜爱飞行游戏的玩家就应当勇于尝试摇杆,光是搓搓鼠标打下几个飞机也能算是飞行爱好者么?真的喜欢飞行的话就应当体验飞行!好了,下面我就言归正传,告诉大家如何操作。
  首先,操控方面,可以进入战争雷霆游戏,里面有关于摇杆的设置向导,千万不要一上来就选那个最后面的,叫什么真实模式操控,那个设置之复杂会让人疯掉,用鼠标后面的那个模式就好,具体设置需要自己稍微研究一下。视角最好采用虚拟座舱视角,就是座舱视角却不显示座舱的那种。
  然后,具体的练习方法,你可以进入游戏之后,选一个飞机(推荐英系的初级台风,有利于熟悉操作)然后进入练习模式,就是只有一个靶车让你打的那个图,可以对靶车进行不同高度下的往返攻击
  嗯有点像这样,也可以找个孤立的树木,房子之类的,甚至战舰也行,这个练习可以作为一项长期基础训练坚持,要达到的效果是在转向之后能够快速的调整好瞄准的准星,并且能够按照自己的预想操控摇杆已达到能够正常的使用摇杆控制飞机。
  当你发现已经可以用摇杆正常的控制飞机时,恭喜你,你已经成为一名华府的低等下人了编号是9527.
  开个玩笑,当你完成这第一步,我保证你会有不错的成就感,不过接下来路还长,接下来你需要进行空中动作的练习,先从最基础的转向,抬升,下降开始,然后是滚转,破s机动之类的基本规避动作,最后再到复杂的滚筒动作,不要小瞧这些动作这些都是你将来空中格斗的基础,目标是能够自由组合并且使用这些动作,并能按照自己的预想飞行使用。
  当你能熟练使用这些动作的时候,你就可以进行一个机场降落的练习,这个练习有之前的基础我相信会很快掌握,当然,降落的越快越熟练越好,航母起降训练也可以选择性的进行,这个航母起降并不强迫。然后就是低空障碍练习,找个地形复杂的图,尽量的低空飞行,越低越好但是也不要贴地太近,因为要做一些动作躲避障碍物,这样可以很好的加强你对飞机的控制能力,对瞄准目标有一定帮助,然后是低空的倒飞练习,这个联系相对难度较大,主要练习的是你的方向感控制能力和对摇杆操控的熟悉程度。这些练习都很重要,而且属于基础练习。可以定期训练。
  然后重要的练习项目来了!就是跟机练习!这个练习可以和基友完成,也可以在游戏中实战完成,就是一个飞机在前面飞,而你就一直跟着他,完全模仿他的动作,模仿到一定程度后,你会发现很多飞行方面的“惯性”现象,这对于预判和瞄准很有帮助。应当多多联系才是!这个练习的终极目标是,即使敌机的微小动作,也可以用摇杆准确复制,并且根据敌机动态预测敌机的下一步动作计划,已达到先发制敌将其击落,楼主我也是在这一步上练习着呢。
  当你完成了以上训练,恭喜你,你已经脱胎换骨了,你已经可以称得上一名模拟飞行玩家了,另外,我想说的一点是,关于历史和全真,使用摇杆的话会出现不少街机中不会出现的问题,如失速过快,尾旋和其他不少的控制问题,这个更加需要耐心和长期的练习!
  说了这么多,我相信大家对如何使用摇杆一定有一定的了解了,如果大家有什么问题尽管发帖,我在这里有问必答,也希望多年摇杆的老鸟多给我这位雏鸟一些经验!
更多相关资讯请关注:
用手机访问
扫一扫,手机浏览
相关新闻:
游戏制作:Gaijin Entertainment
游戏发行:腾讯游戏
游戏平台:PC/PS4
上市时间:
游戏特色:
《战争雷霆》1.55版本新飞机:飞燕丁与钟馗乙历史模式飞行性能点评。
战争雷霆德系坦克怎么样?战争雷霆德系轻型坦克35T在标准战斗下战力爆表,不愧是德系坦克,就算在游戏内也这么厉害。下面由小编带来的精彩击杀视频。
《战争雷霆》2015TGC还原空地联动战场,至强空战战斗,陆地决战,钢铁同盟,为战争集结火力全开!
战争雷霆为我们带来了真实的二战体验,真实的载具,高度还原的战场。下面就请大家一起来欣赏战争雷霆高清截图吧。
战争雷霆为我们带来了真实的二战体验,真实的载具,高度还原的战场。下面就请大家一起来欣赏战争雷霆高清截图吧。
由腾讯代理运营的《战争雷霆》25日开启集结内测,游戏新推出了火箭炮供玩家体验,小编也在第一时间为大家带来了一手截图。
《战争雷霆》“集结内测”是这款战争网游大作的国服首轮内测。此次测试以二战胜利终结,以载具全面进入“冷战”时代为主题。
战争雷霆增加了可开关的飞机驾驶舱盖、驾驶舱照明灯和更多可损坏坦克外挂部件在增加了画面的表现力,质量得到提升配置却没增加。
战争雷霆纪念815日本无条件投降70周年。日,日本政府正式无条件投降。战争雷霆》以和为镜,以战为鉴,向抗战英雄致敬!
战争雷霆都有什么飞机?战争雷霆是现阶段拥有目前最全面的战争载具网游,喜欢飞机或坦克的朋友不可错过的游戏,下面小编给大家带来战争雷霆飞机小合集。
战争雷霆类似的战争题材的游戏在产品形态上变得空前丰富,产品品质上的提升幅度也始终与动作游戏、角色扮演游戏一样处于第一梯队。
综合热点资讯
单机游戏下载unity3d&摇杆控制(C#)
&using UnityE&
using System.C&
public class Controller : MonoBehaviour
&&& public
MPJoystick
touchKey_x=moveJoystick.position.x;&
touchKey_y=moveJoystick.position.y;&
print(touchKey_x+"||"+touchKey_y);
if(touchKey_x ==
0&&touchKey_y==0)
if(!animation.isPlaying)
animation.Play("Idle");//我里面的一个动画&
animation.Play("Walk");//行走的动画&
transform.LookAt(new
Vector3(touchKey_x*100000,transform.position.y,touchKey_y*100000));&
transform.Translate(Vector3.forward*5*Time.deltaTime);&
摇杆类:& 看了半天 不大明白 贴出来直接用就成
[RequireComponent(typeof(GUITexture))]&
&&& public class
MPJoystick : MonoBehaviour&
Boundary {&
&&& public
Vector2 min = Vector2.&
&&& public
Vector2 max = Vector2.&
&&& private
static MPJoystick[]&&
// A static collection of all joysticks&
&&& private
static bool enumeratedJoysticks =&
&&& private
static float tapTimeDelta =
0.3f;&&& // Time
allowed between taps&
&&& public bool
&&& public
Vector2 position = Vector2.&
&&& public Rect
&&& public
Vector2 deadZone = Vector2.& // Control when
position is output&
&&& public bool
normalize = // Normalize output after the
dead-zone?&
&&& public int
tapC&&&&&&
&&& private int
lastFingerId = -1;&& // Finger
last used for this joystick&
&&& private
tapTimeW&&&&
// How much time there is left for a tap to
&&& private
Vector2 fingerDownP&
&&& //private
float fingerDownT&
&&& //private
float firstDeltaTime = 0.5f;&
&&& private
&&& private Rect
defaultR&&&
// Default position / extents of the joystick
&&& private
Boundary guiBoundary = new
Boundary();&& // Boundary for
joystick graphic&
&&& private
Vector2 guiTouchO& // Offset to apply to
touch input&
&&& private
Vector2 guiC&& // Center of
&&& void Start()
(GUITexture)GetComponent(typeof(GUITexture));&
&&& defaultRect
= gui.pixelI&
defaultRect.x += transform.position.x * Screen.// +
gui.pixelInset.x; // -& Screen.width *
&&&&&&&&&&&
defaultRect.y += transform.position.y * Screen.// -
Screen.height * 0.5;&
transform.position = Vector3.&
(touchPad) {&
&&& // If a
texture has been assigned, then use the rect ferom the gui as our
touchZone&
gui.texture )&
&&& touchZone =
&&& } else
guiTouchOffset.x = defaultRect.width *
guiTouchOffset.y = defaultRect.height *
&&& // Cache the
center of the GUI, since it doesn't change&
&&& guiCenter.x
= defaultRect.x + guiTouchOffset.x;&
&&& guiCenter.y
= defaultRect.y + guiTouchOffset.y;&
&&& // Let's
build the GUI boundary, so we can clamp joystick
guiBoundary.min.x = defaultRect.x -
guiTouchOffset.x;&
guiBoundary.max.x = defaultRect.x +
guiTouchOffset.x;&
guiBoundary.min.y = defaultRect.y -
guiTouchOffset.y;&
guiBoundary.max.y = defaultRect.y +
guiTouchOffset.y;&
&&& public
Vector2 getGUICenter() {&
&&& return
Disable() {&
gameObject.active =&
//enumeratedJoysticks =&
&&& private void
ResetJoystick() {&
gui.pixelInset = defaultR&
&&& lastFingerId
&&& position =
fingerDownPos = Vector2.&
&&& private bool
IsFingerDown() {&
&&& return
(lastFingerId != -1);&
&&& public void
LatchedFinger(int fingerId) {&
another joystick has latched this finger, then we must release
lastFingerId == fingerId )&
ResetJoystick();&
Update() {&
(!enumeratedJoysticks) {&
&&& // Collect
all joysticks in the game, so we can relay finger latching
&&& joysticks =
(MPJoystick[])FindObjectsOfType(typeof(MPJoystick));&
enumeratedJoysticks =&
&&& int count =
Input.touchC&
tapTimeWindow & 0 )&
tapTimeWindow -= Time.deltaT&
&&& tapCount =
&&& if ( count
ResetJoystick();&
&&& for(int i =
0; i & i++) {&
&&& Touch touch
= Input.GetTouch(i);&
&&& Vector2
guiTouchPos = touch.position -
guiTouchO&
shouldLatchFinger =&
(touchPad) {&
(touchZone.Contains(touch.position))&
shouldLatchFinger =&
&&& else if
(gui.HitTest(touch.position)) {&
shouldLatchFinger =&
&&& // Latch the
finger if this is a new touch&
(shouldLatchFinger && (lastFingerId
== -1 || lastFingerId != touch.fingerId ))
(touchPad) {&
//gui.color.a = 0.15;&
&&& lastFingerId
= touch.fingerId;&
//fingerDownPos = touch.&
//fingerDownTime = Time.&
&&& lastFingerId
= touch.fingerId;&
Accumulate taps if it is within the time
tapTimeWindow & 0 )&
tapCount++;&
&&& tapCount =
tapTimeWindow = tapTimeD&
&&& // Tell
other joysticks we've latched this finger&
(& j : Joystick in joysticks
&&& foreach
(MPJoystick j in joysticks) {&
&&& if (j !=
j.LatchedFinger( touch.fingerId );&
lastFingerId == touch.fingerId ) {&
&&& // Override
the tap count with what the iPhone SDK reports if it is
&&& // This is a
workaround, since the iPhone SDK does not currently track
&&& // for
multiple touches&
touch.tapCount & tapCount )&
&&& tapCount =
touch.tapC&
touchPad ) {&
&&& // For a
touchpad, let's just set the position directly based on distance
from initial touchdown&
&&& position.x =
Mathf.Clamp( ( touch.position.x - fingerDownPos.x ) / (
touchZone.width / 2 ), -1, 1 );&
&&& position.y =
Mathf.Clamp( ( touch.position.y - fingerDownPos.y ) / (
touchZone.height / 2 ), -1, 1 );&
&&& } else
&&& // Change
the location of the joystick graphic to match where the touch
&&& Rect r =
gui.pixelI&
=& Mathf.Clamp( guiTouchPos.x, guiBoundary.min.x,
guiBoundary.max.x );&
=& Mathf.Clamp( guiTouchPos.y, guiBoundary.min.y,
guiBoundary.max.y );&
gui.pixelInset =&
(touch.phase == TouchPhase.Ended || touch.phase ==
TouchPhase.Canceled)&
ResetJoystick();&
(!touchPad) {&
&&& // Get a
value between -1 and 1 based on the joystick graphic
&&& position.x =
( gui.pixelInset.x + guiTouchOffset.x - guiCenter.x ) /
guiTouchOffset.x;&
&&& position.y =
( gui.pixelInset.y + guiTouchOffset.y - guiCenter.y ) /
guiTouchOffset.y;&
&&& // Adjust
for dead zone&
absoluteX = Mathf.Abs( position.x );&
absoluteY = Mathf.Abs( position.y );&
(absoluteX & deadZone.x) {&
&&& // Report
the joystick as being at the center if it is within the dead
&&& position.x =
&&& else if
(normalize) {&
&&& // Rescale
the output after taking the dead zone into
&&& position.x =
Mathf.Sign( position.x ) * ( absoluteX - deadZone.x ) / ( 1 -
deadZone.x );&
(absoluteY & deadZone.y) {&
&&& // Report
the joystick as being at the center if it is within the dead
&&& position.y =
&&& else if
(normalize) {&
&&& // Rescale
the output after taking the dead zone into
&&& position.y =
Mathf.Sign( position.y ) * ( absoluteY - deadZone.y ) / ( 1 -
deadZone.y );&
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。没有更多推荐了,
不良信息举报
举报内容:
Unity3D中关于游戏摇杆的实现方法
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!unity实现3d摇杆 结合leapmotion控制实现VR场景移动
unity实现3d摇杆 结合leapmotion控制实现VR场景移动
Created by miccall
(转载请注明出处
3D UI设想 解决VR场景移动
开发vr很恼火的就是场景的移动 真实地方本来就小,如果vr里面的场景也小,那还玩个啥,所以虚拟现实的场景是很大的 如何实现小空间对大空间的移动,这也是vr开发要解决的问题之一 。
我们老大设想了摇杆操作 我就顺着思路做了一套 先看看基本效果
-当手移动中间的球时候 ,就像触碰摇杆一样 ,可以向四周摇动 。
外面的环是一个指示器 当球触发到环的时候,给一个颜色的变化,让用户知道自己将朝哪一个方向运动 。
下面是一个围棋场地 用来感受自己在环境中的移动。
摄像机 包括controller都在一个游戏物体上面 也很好移植 ,下面就一步步来展示这个的制作过程 。
3d摇杆的基本框架
首先建立一个MianPivot的空物体 它代表着游戏人物 到时候可以自己设定 。
其下呢 ,一个是VR视角 可以选用官方的LMHeadMountedRig 这个预制体 。
另一个就是我门要做的这个摇杆了 。
摇杆分为三部分 BoundaryRing 就是外面的一个指示环 。root是一个中心点 用来归位 sphere是一个移动的球,用手来触碰它 让它在空间中移动,实现摇杆效果 。
看过摇杆的自动归位 ,一开始是拿弹簧力来实现,但是弹簧回弹的惯性极其的难掌控 ,来回摆动简直让人抓狂 。于是, 果断放弃了unity的弹簧力 改自己写插值移动 ,让它在手不触碰他的时候,就让它移动到root这个点 。
大概一分析就是这么简单的东西了,但是写起来还是比较烦的,bug极其的多,如何判断手的hold 如何判断移动 回弹的触发条件 等等一系列 做出好的效果还是很不容易的。
还有就是状态的类,球是否是移动的状态 手是否是hold的状态 这个也得写个类来管理
那么物体上呢 ,就很简单了 加一个触发器 当触发的时候 改变他们的状态 。
大家自己建立两个球(一个root点 一个移动的球)并把他们放到一个父物体下面,就可以开始写脚本了。
开始写脚本
先在父类上面建立一个Controller脚本 用来管理游戏移动对象, root和sphere 。
好 那就先这样写
public class springController : MonoBehaviour
[Tooltip("Navigation Controls the walking game object")]
public GameO
[Tooltip("Used to move the navigation ball")]
public GameO
[Tooltip("The root node of the navigation (reset point)")]
public GameO
float speed = 5f;
void Start()
sphereposition = sphere.transform.localP
rootposition = root.transform.localP
void Update()
sphereposition = sphere.transform.localP
Movecheck();
setstop();
void setstop()
if (HandState.Handstate == HandState.HandStateRelease)
float step = speed * Time.deltaT
sphere.GetComponent&Rigidbody&().velocity = Vector3.
sphere.transform.localPosition = new Vector3(Mathf.Lerp(sphereposition.x, rootposition.x, step), Mathf.Lerp(sphereposition.y, rootposition.y, step), Mathf.Lerp(sphereposition.z, rootposition.z, step));
if (SphereState.Spherestate == SphereState.Spherestateclosed)
sphere.transform.localPosition = new Vector3(0, 0, 0);
void debugshpereposition()
print("sphereposition" + sphereposition);
void Movecheck()
if(HandState.Handstate == HandState.HandStateHold)
startfollow();
else if(SphereState.Spherestate == SphereState.Spherestateclosed)
Stopfollow();
void startfollow()
transform.parent.GetComponent&test&().enabled = true;
void Stopfollow()
transform.parent.GetComponent&test&().enabled = false;
void OnTriggerExit(Collider other)
if (issphere(other))
HandState.Handstate = HandState.HandStateR
setstop();
bool issphere(Collider other)
return other.transform.name == "Sphere";
然后就是root和sphere上面 各有一个triiger判断的类
public class rootTrigger : SphereState
enum currentstate
colse,move
void OnTriggerEnter(Collider collider)
currentcollider =
state = currentstate.
void OnTriggerExit(Collider collider)
currentcollider =
state = currentstate.
public override bool isclosed()
if (Isphere(currentcollider))
if (state == currentstate.colse)
return true;
else return false;
return false;
private bool Isphere(Collider collider)
return collider.transform.name == "Sphere" ;
void spheredebug(Collider collider,string state)
if (Isphere(collider))
print("Sphere"+"
"+ state);
public class HnadTrigger : HandState
handcount = 0 ;
void OnTriggerEnter(Collider other)
if(IShand(other))
handcount++;
void OnTriggerExit(Collider other)
if(IShand(other))
handcount--;
bool IShand(Collider other)
string Collidername = other.transform.parent.
if (Collidername == "thumb") return true;
else if (Collidername == "index") return true;
else if (Collidername == "middle") return true;
else if (Collidername == "thumb") return true;
else if (Collidername == "RigidRoundHand_L" || Collidername == "RigidRoundHand_R") return true;
else return false;
void handdebug(Collider other, string state)
print("hand" + state+" ++++++++++++" + Time.time);
public override bool ishold()
if (handcount != 0)
return true;
return false;
这个hold的状态也是搞了我很久 没办法处理判断hold和release两个状态
最后想到的用碰撞器的数量来判断吧 ,当进入trigger就加加 出去就减减 最后数量为0 那么就是松开状态了
public class HandState : MonoBehaviour {
public static int HandStateHold = 0 ;
public static int HandStateRelease = 1;
public static int Handstate = HandStateR
public virtual bool ishold()
return true;
void setvalue()
if (ishold())
Handstate = HandStateH
StartCoroutine(WaitAndPrint(0.5F));
IEnumerator WaitAndPrint(float waitTime)
yield return new WaitForSeconds(waitTime);
Handstate = HandStateR
void Update()
setvalue();
public class SphereState : MonoBehaviour {
public static int Spherestateclosed = 0;
public static int Spherestatemove = 1;
public static int Spherestate = S
public virtual bool isclosed()
return false;
void setvalue()
if (isclosed())
Spherestate = S
Spherestate = S
void Update()
setvalue();
这个就比较简单了 也就不多解释了 有想要源码的,可以留言联系我 。
好了 ,今天就将怎么多啦 ,祝自己新年快乐。
看过本文的人也看了:
我要留言技术领域:
取消收藏确定要取消收藏吗?
删除图谱提示你保存在该图谱下的知识内容也会被删除,建议你先将内容移到其他图谱中。你确定要删除知识图谱及其内容吗?
删除节点提示无法删除该知识节点,因该节点下仍保存有相关知识内容!
删除节点提示你确定要删除该知识节点吗?

我要回帖

更多关于 unity3d 震动 的文章

 

随机推荐