Question: what is wrong with code there, the line: rb.velocity = Rigidbody. velocity.normilized: shows an error? using System.Collections; using System.Collections.Generic; using UnityEngine; //This is used for

what is wrong with code there, the line: rb.velocity = Rigidbody. velocity.normilized: shows an error?

using System.Collections; using System.Collections.Generic; using UnityEngine; //This is used for Unity 5, Here you will create a c# code that will check the current y value on the rigid body. //If the y-value is higher than the existing, overwrite it. (That way you will only store the maximum y-value). public class Speed : MonoBehaviour { public Rigidbody rb; public float y = 100f; // Use this for initialization void Start() { rb = GetComponent(); } // Update is called once per frame void FixedUpdate() { if (rb.velocity.magnitude > y) { rb.velocity = Rigidbody.velocity.normalized; } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!