C# Unexpected symbol

Where is mistake?

the “int” before transform

1 Like

Next time just paste your code instead of a screenshot…

1 Like

it is also underlined red. so not difficult to spot. you should evaluate the marked expression for yourself and check if it makes sense. the ide should help you by providing types + parameters at mouse over.

I’m sorry for my mistake with screenshot. I’m in this first time.
I give float instead of int.

using UnityEngine;
using System.Collections;

public class Shooter : MonoBehaviour {
public Rigidbody bullet;
public float power = 1500f;
public float moveSpeed = 2f;
void Update () {
float transform.Translate(h, v, 0);
}
}

Where precisely was float in this line:
float transform.Translate(h, v, 0);
???

float transform.Translate(h, v, 0);

you can’t write FLOAT before “transform.Translate(h, v, 0);”

you declare a float.

like:

float myFloat;

this is basic coding knowledge. Check out some coding tutorials before you start:

http://youtu.be/vijrmWIN1Ho

1 Like