Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
lucian112

Help Move script Please

Question

Any ideas why my capsule dosen't move? 

Like i press W,A,S,D And nothing happend,please help!

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace player
{
    public class Move : MonoBehaviour
    {
        public float speed;

        private void FixUpdate()
        {
            float WS = Input.GetAxis("Vertical") * speed;
            float AD = Input.GetAxis("Horizontal") * speed;

            transform.Translate(AD, 0, WS);
        }
        
    }
}

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts


  • 0

You just had this exact same issue on Saturday. Always recheck your work for spelling mistakes

 

just think of it like this. Your not wanting to create a function that fixes the update, your wanting to use a function that has already been fixed. Hint Fix(ed) update and not fix. Because if it was called FixUpdate, then that would mean the update loop has not been fixed yet which would make no sense putting anything in it. Coding is just a form of writing, if it makes no sense when you read it back, then you misstyped something

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...