- Home /
Question by
voodoo664 · Apr 04, 2014 at 01:47 AM ·
vector3controllerconstructor
Vector3 Error?
Assets/Standard Assets/Character Controllers/Sources/Scripts/JetPack.js(11,32): BCE0024: The type 'UnityEngine.Vector3' does not have a visible constructor that matches the argument list '(int, int, float, int)'.
here's my code:
#pragma strict
var cm : CharacterMotor;
var jetpack : AudioClip;
private var thisAudio : AudioSource;
function Start(){
cm = GetComponent("CharacterMotor");
thisAudio = GetComponent("AudioSource");
}
function Update(){
if(Input.GetKeyDown("left shift")){
cm.movement.velocity += Vector3(0,1,1f,0);
thisAudio.clip = jetpack;
if (!thisAudio.isPlaying)
thisAudio.Play();
}
if(Input.GetKeyUp("left shift")){
thisAudio.Stop();
}
}
Comment
The error is pretty descriptive. Your use of Vector3() in line 11 has four parameters. Vector3() takes only three parameters. It takes floats will will convert the int values for you.
Your answer
Follow this Question
Related Questions
Unity 8-Directional Locked Movement (Super Mario 3D World Style) 3 Answers
MMD How to export model and animations to Unity as 3rd person controller? 2 Answers
XBox Controller Angle of Fire Incorrect 0 Answers
Slow falling when using Rigidbody set velocity as playercontroller 0 Answers
Problem with adjusting vector. 2 Answers