Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Why does my code for the w movement to go up using the vectors not work below is my code. using System.Collections; using System.Collections.Generic; using
Why does my code for the w movement to go up using the vectors not work below is my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
const float speed f;
Vector velocity;
Start is called before the first frame update
void Start
velocity speed new Vectorfff;
Update is called once per frame
void Update
Debug.LogHi;
if InputGetKeyw
velocity new Vectorvelocityx speed, f;
else if InputGetKeya
velocity new Vector speed, velocity.yf;
else if InputGetKeys
velocity new Vectorvelocityx speed, f;
else if InputGetKeyd
velocity new Vector speed, velocity.yf;
transform.position velocity Time.deltaTime;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started