- Home /
Question by
CrapShackerGames · Mar 04 at 10:38 PM ·
values
so i am making a hard mode but the values are not changing can you help?
so in another script i have it setup to run the hard bit of the script but the values dont change in game
{ public Rigidbody Player; public float m_speed, rotatespeed; public bool failSafe; void Start() {
}
public void HardMZ()
{
if (failSafe == false)
{
m_speed =- 200;
failSafe = true;
}
}
void FixedUpdate()
{
if (Input.GetKey(KeyCode.W))
{
Player.velocity = transform.forward * m_speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.S))
{
Player.velocity = -transform.forward * m_speed * Time.deltaTime;
}
}
void Update()
{
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(0, -rotatespeed * Time.deltaTime, 0);
}
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(0, rotatespeed * Time.deltaTime, 0);
}
}
}
Comment
Answer by Caeser_21 · Mar 05 at 12:24 PM
Could you also post the other script that calls "HardMZ()"?
Your answer
Follow this Question
Related Questions
How to smootlhy change values in amout of time? 3 Answers
Synchronizing multiple values 1 Answer
How do I create a Key and Values Dictionary array in C# 1 Answer
Adding the values of two functions together to display the total 1 Answer
How to have Database of Dictionary elements with online images??? 0 Answers