Blogger Information
Blog 95
fans 0
comment 11
visits 248828
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Unity3d控制物体移动WSAD键
龍__遇见彩虹的博客
Original
1165 people have browsed it

//前后左右移动
    public float moveSpeed = 20;
    private float h;
    private float v;


void LateUpdate () {

        //物体前后左右移动
        h = Input.GetAxis("Horizontal");
        v = Input.GetAxis("Vertical");
        transform.Translate(new Vector3(h, 0, v) * Time.deltaTime * moveSpeed);
    }

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post