- Home /
This question was
closed Feb 12, 2013 at 04:31 AM by
sona.viswam for the following reason:
The question is answered, right answer was accepted
Question by
sona.viswam · Feb 11, 2013 at 07:46 AM ·
c#positionvector3
addition of vector3
i am getting error in c# while adding two vectors, in class i declared
public Vector3 floorPosition;
in start function i declared
void Start () {
floorPosition = new Vector3(0,0.5f,-8.25f);
}
in another function i added floorPosition = floorclone.transform.position + Vector3(0,0,2); Please help to get out of this error. thanks in Advance
Comment
Best Answer
Answer by mrde · Feb 11, 2013 at 07:55 AM
Vector3 floorPosition = floorclone.transform.position + new Vector3(0,0,2f);
getting error : Expression denotes a type', where a
variable', value' or
method group' was expected
look, here is working code in c#
using UnityEngine;
public class pzik : $$anonymous$$onoBehaviour
{
public GameObject floorclone;
void Start()
{
Vector3 floorPosition = floorclone.transform.position + new Vector3(0, 0, 2f);
}
}
Follow this Question
Related Questions
C# Transform modification. 1 Answer
AI Patrolling 1 Answer
Guided missile help c# 1 Answer
Randomly Generated Objects 1 Answer