J'ais un serieux probleme avec les script

Toutes les questions relatives aux tutoriels du site sont à poser à cet endroit.
Geek_and_Play
Messages : 5
Inscription : 19 Mai 2012 19:47

J'ais un serieux probleme avec les script

Message par Geek_and_Play » 20 Mai 2012 14:12

Voila cela fai deux jour que j essai de resoudre mon probleme avec le script de l'étape 4 du FPS .Je ne trouve pas mes erreurs, quand je lance en playmode cela me dit :

"all compiler errors have to be fixed befor you can enter playmode !"

et j ai plein d'erreur afficher en bas :(

aider moi s'il vous plait .

Merci d avance :)
var fireRate=0.30;
var impact:GameObject;
var canFire=true;

function Update(){
if(Input.GetButton("Fire1")){
fire();
}
}

function fire(){
if (canFire==true){
canFire=false;
FireOneShot();
}
}

function FireOneShot(){
var direction=transform.TransformDirection(Vector3.forward);//..Renvoie la direction devant la caméra
var hit:RaycastHit;

if (Physics.Raycast(transform.position,direction,hit,range)){
tempRot=Quaternion.FromToRotation(Vector3.up,hit.normal);//..Direction de l'impact
Instantiate(impact,hit.point,tempRot);
}
yield WaitForSeconds(fireRate);
canFire=true;
}

Avatar de l’utilisateur
mel68
Messages : 827
Inscription : 04 Fév 2012 14:57

Re: J'ais un serieux probleme avec les script

Message par mel68 » 20 Mai 2012 14:37

Tu peu mettre tes erreurs stp ce sera plus simple pour nous ;)
Bonjour bonjour, je tien juste a vous avertir promptement que ce message ne sert totalement a rien

Geek_and_Play
Messages : 5
Inscription : 19 Mai 2012 19:47

Re: J'ais un serieux probleme avec les script

Message par Geek_and_Play » 20 Mai 2012 15:11

MissingFieldException: Field 'UnityEngine.Vector3.direction' not found.
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateGetter ()
Boo.Lang.Runtime.RuntimeServices.DoCreatePropGetDispatcher (System.Object target, System.Type type, System.String name)
Boo.Lang.Runtime.RuntimeServices.CreatePropGetDispatcher (System.Object target, System.String name)
Boo.Lang.Runtime.RuntimeServices+<GetProperty>c__AnonStorey14.<>m__9 ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
shoot script:fire() (at Assets/script/shoot script.js:15)
shoot script:Update() (at Assets/script/shoot script.js:8)




et

ssets/script/shoot script.js(22,23): BCE0023: No appropriate version of 'UnityEngine.Physics.Raycast' for the argument list '(UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.RaycastHit, function(int): System.Collections.Generic.IEnumerable.<int>)' was found.


voila :?:

Avatar de l’utilisateur
mel68
Messages : 827
Inscription : 04 Fév 2012 14:57

Re: J'ais un serieux probleme avec les script

Message par mel68 » 20 Mai 2012 15:26

deja au lieu de range mais 100 a là :

if(Physics.Raycast(transform.position,direction,hit,100))

je ne sais pas si c'est ca mais j'espere :)
Bonjour bonjour, je tien juste a vous avertir promptement que ce message ne sert totalement a rien

Avatar de l’utilisateur
krys64
Fondateur unity3d-france
Fondateur unity3d-france
Messages : 471
Inscription : 26 Nov 2009 00:08

Re: J'ais un serieux probleme avec les script

Message par krys64 » 20 Mai 2012 15:34

Faudrait voir a faire des recherches sur le site avant :
viewtopic.php?f=18&t=3598&p=21734&hilit ... ion#p21734

Geek_and_Play
Messages : 5
Inscription : 19 Mai 2012 19:47

Re: J'ais un serieux probleme avec les script

Message par Geek_and_Play » 20 Mai 2012 15:36

Alors j' ai deja enlever une erreur en enlevant la dernier accolade :)

Mais il me reste encore :

MissingFieldException: Field 'UnityEngine.Vector3.direction' not found.
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)

mais quand j ai fait ce que tu ma dit cela n'a rien changer mais merci pour ton aide ;)

Maintenant je peut lance le jeu mais il y a un problème , je peut tirer que une seul fois et les étincelles reste en permanence

Avatar de l’utilisateur
mel68
Messages : 827
Inscription : 04 Fév 2012 14:57

Re: J'ais un serieux probleme avec les script

Message par mel68 » 20 Mai 2012 15:37

pour les etincelle il faut que tu coche autodestruc
Bonjour bonjour, je tien juste a vous avertir promptement que ce message ne sert totalement a rien

Geek_and_Play
Messages : 5
Inscription : 19 Mai 2012 19:47

Re: J'ais un serieux probleme avec les script

Message par Geek_and_Play » 20 Mai 2012 15:46

merci mais cela ne resoud pas le probleme : Je peut tiré qu'une seul fois quand je reclick rien ne se passe :(

Merci

Avatar de l’utilisateur
mel68
Messages : 827
Inscription : 04 Fév 2012 14:57

Re: J'ais un serieux probleme avec les script

Message par mel68 » 20 Mai 2012 15:47

alors la je ne peu pas t'aider :( essaye de baisser fireRate et reste appuyer sur ta souris
Bonjour bonjour, je tien juste a vous avertir promptement que ce message ne sert totalement a rien

Geek_and_Play
Messages : 5
Inscription : 19 Mai 2012 19:47

Re: J'ais un serieux probleme avec les script

Message par Geek_and_Play » 20 Mai 2012 15:50

Merci a toi Mel j ai reussi .Enfaite a la ligne 22 a il fallai mettre une accolade apres 100))

je suis heureux XD encor merci

Verrouillé

Revenir vers « Tutoriels du site Unity3D-france »