using System.Collections; using System.Collections.Generic; using UnityEngine; ///…
- User
using System.Collections; using System.Collections.Generic; using UnityEngine;
/// /// This is used to make FollowingFog move its x and z position along with the /// plane while keeping the Y position of this object =0 so that it stays /// on the ground. /// In this game, the plane is pointOfInterest. /// [DisallowMultipleComponent] public class GroundFollow : MonoBehaviour { public Transform pointOfInterest;
void FixedUpdate() { // Set the position of transform to the position of pointOfInterest, but // make sure that the y is locked to 0 }} Fill out the code for the comments listed under the FixedUpdate() function
- Assistant
void FixedUpdate() { // Set the position of transform to the position of pointOfInterest, // but make sure that the y is locked to 0 transform.position = new Vector3(pointOfInterest.position.x, 0f, pointOfInterest.position.z); }