Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development

Justine Knight
Justine Knight
195 Points

Fly Animation won't start. There is only the wing animation but no circles.

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class FlyMovement : MonoBehaviour {

[SerializeField]
private Transform center;


private float flySpeed; 


void Start () {

    flySpeed = Random.Range (300f, 700f); 

}

// Update is called once per frame
void Update () {
    transform.RotateAround (center.position, Vector3.up, flySpeed * Time.deltaTime);

}

}

Tojo Alex
Tojo Alex
Courses Plus Student 13,331 Points

is there any error in the console in the Unity Editor.

Justine Knight
Justine Knight
195 Points

This is a main error

Assets/Scripts/FlyMovement.cs(21,19): error CS1644: Feature `expression bodied members' cannot be used because it is not part of the C# 4.0 language specification

1 Answer

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I'm not entirely sure what is wrong because your code seems right though you can use this: using System.Collections; using System.Collections.Generic; using UnityEngine;

public class FlyMovement : MonoBehaviour {

[SerializeField]
private Transform center;

private float flySpeed;

// Use this for initialization
void Start () {
    flySpeed = Random.Range (300f, 700f);
}

// Update is called once per frame
void Update () {
    transform.RotateAround (center.position, Vector3.up, flySpeed * Time.deltaTime);
}

}

There can be loads of possibilities of what's wrong though If you continue watching the next few videos it may give you the answers that you need. I did say that I don't see any error's though I recommend that you check between lines 19 and 21 in the script.