Question by
Kampret1st · Oct 24, 2015 at 01:44 PM ·
bug report
bug in unity 5?
i follow this tutorial for making flapping bird,, but my bird "no go up" when i touch the screen https://www.youtube.com/watch?v=dWtoB3J1YTg
this is my script
using UnityEngine;
using System.Collections;
public class SpermMovement : MonoBehaviour
{
Vector3 velocity = Vector3.zero;
public Vector3 gravity;
public Vector3 flapvelocity;
bool didFlap = false;
// Use this for initialization
void Start(){
}
//DO GRAPHIC & INPUT UPDATE HERE
void update() {
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0) ) {
didFlap = true;
}
}
// DO PHYSICS ENGINE UPDATE HERE
void FixedUpdate() {
velocity += gravity * Time.deltaTime;
if (didFlap == true) {
didFlap = false;
velocity += flapvelocity;
}
transform.position += velocity * Time.deltaTime;
}
}
please help
Comment
Best Answer
Answer by Statement · Oct 24, 2015 at 01:51 PM
The "bug in Unity 5" is that your update function is never called because you named it update
and not Update
.
Case sensitivty matters.
(And no, it's not a bug in Unity, it's a bug in your code)
Your answer
Follow this Question
Related Questions
Missing Shadows on Some Objects 0 Answers
Terrain paint tool does not work. 0 Answers
No Video in certain Unity games,No Video in certain unity games 0 Answers
AssetGraph Bug Fix Requset 0 Answers
Crash after DisconnectEvent 0 Answers