So all this script is doing is detecting the relative speed of movement and rotation of an object and then combining those to output a float to another game object. when I multiply the variable heightDifference it works as expected, but for some reason, rotDiff does not change. the output I’m getting for heightDifference is between .01 and .04 and for rotDiff are between -9 and 10. not only will the number not multiply (I have tried breaking it out into many steps) but it’s not impacting the final output of speedMultiplier.
Have I just missed something super silly?
![using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MagnitudeToSpeed : MonoBehaviour
{
public float speedMultiplier;
public Vector3 startingPos;
public Vector3 startingRot;
public float heightDifference;
public float rotDiff;
// Start is called before the first frame update
void Start()
{
startingPos = transform.position;
startingRot = transform.localEulerAngles;
}
// Update is called once per frame
void Update()
{
rotDiff = transform.localEulerAngles.x - startingRot.x;
heightDifference = transform.position.x - startingPos.x;
speedMultiplier = 1 + (Mathf.Abs(heightDifference) * 100) + (Mathf.Abs(rotDiff) * 100);
startingPos = transform.position;
startingRot = transform.localEulerAngles;
}
}][1]