- Home /
js to C# converstion Problem
I am trying to convert a script from js to C# and it all works but one part and I am not sure how to fix this. The error I am getting is this :
Assets/Scripts/Cells.cs(14,21): error CS0119: Expression denotes a type', where a
variable', value' or
method group' was expected
The script is this:
using UnityEngine;
using System.Collections;
public class Cells : MonoBehaviour {
Transform[] Adjacents;
Vector3 position;
int weight;
Color highLight;
Color colorPlate;
void Start (){
highLight = Color(1, 0, 0, 1);
colorPlate = renderer.material.GetColor("_Color");
}
void OnMouseEnter (){
renderer.material.color = highLight;
}
void OnMouseExit (){
renderer.material.SetColor ("_Color", colorPlate);
}
}
Answer by MissingSemicolon · Jul 01, 2013 at 03:32 PM
I think it is this line here:
highLight = Color(1, 0, 0, 1);
It needs to be:
highLight = new Color(1, 0, 0, 1);
Give that a try :)
Answer by Em3rgency · Jul 01, 2013 at 03:31 PM
Probably needs to be
highLight = new Color(1, 0, 0, 1);
Just a guess though.
lol you guys all posted within 2 $$anonymous$$utes of eachother xD Em3rgency, I gave you an upvote for being first but not getting picked ;)
Your answer
Follow this Question
Related Questions
Create a guitexture When clicked on 3d text? 0 Answers
Convert js to C# Serializer problem 1 Answer
.js to C# conversion 4 Answers
How would i convert this from JS into C#? 2 Answers
Gameobject variable on C# 1 Answer