Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Error with Vector3 in Boo code

Discussion in 'Scripting' started by Younes, Feb 23, 2015.

  1. Younes

    Younes

    Joined:
    Jan 21, 2015
    Posts:
    12
    Code (Boo):
    1. import UnityEngine
    2.  
    3. class NewBehaviourScript (MonoBehaviour):
    4.  
    5.     speed as double
    6.  
    7.     def FixedUpdate():
    8.         moveHorizontal as double = Input.GetAxis("Horizontal")
    9.         moveVertical as double = Input.GetAxis("Vertical")
    10.  
    11.         movement as Vector3 = Vector3(moveHorizontal,0,0,moveVertical)
    12.  
    13.         rigidbody.AddForce(movement * speed * Time.deltaTime)
    I get this error:
    Can somebody point out what I'm doing wrong? I'm trying to make ball roll on a playing field.
     
    Last edited: Feb 23, 2015
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,935
    Probably needs something like:
    Code (Boo):
    1. movement as Vector3 = Vector3(moveHorizontal, 0, moveVertical)
     
  3. Younes

    Younes

    Joined:
    Jan 21, 2015
    Posts:
    12
    Yes I was just experimenting with that but I was using a , as decimal point, thanks!