My code, as good as i can do, probably not the best but ya’know.
anyway, Its giving me grief in the console in Unity, telling me to swap ='s for :'s ect.
So can someone have a look see whats up? Thanks!
I get these errors: (17,18) expecting(, found ‘OnMouseOver’.
(19,9) Unexpected token: if.
( 21,20) expecting :, found ‘=’.
var maxDist : float;
var forceStrength = 10.0;
var reverseStrength = -10.0;
private var applyForce = false;
private var reverseForce = false;
function Awake()
{
var hit : RaycastHit;
if(Physics.Raycast(transform.position, transform.forward, hit, maxDist))
{
if(hit.transform.tag == "Dynamic")
{
function OnMouseOver();
{
if(Input.GetMouseButton(0));
{
applyForce = true
}
else
{
applyForce = false;
}
if(Input.GetMouseButton(0))
{
reverseForce = true;
}
else
{
reverseForce = false;
}
}
}
function OnMouseExit()
{
applyForce = false;
reverseForce = false;
}
}
}
Thanks.