Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Was the cattle scale a fixture?

Answered: 1 week ago