|
This is the error message I get. Assets/Scipt0/Gun.js(22,20): BCE0023: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(UnityEngine.Transform, UnityEngine.Vector3, UnityEngine.Vector3)' was found. This is my script. var sparks : Transform; var ammo : int = 100; var fireRate : float = 0.2; private var nextFire : float = 0.0; function Update () { } function fire(){ }
(comments are locked)
|
|
Here: :) Instantiate requres a special rotation structure called a Quaternion be used to describe it's starting rotation. Quaternion.LookRotation() does basically what you intended by figuring out what rotation is requried to look at a point in space when standing at (0,0,0). Thanks dude, I'll make sure not to make the mistake again :P
Dec 20 '11 at 02:00 AM
Hannandh
Give me a +1 please :)
Dec 20 '11 at 02:01 AM
Zergling103
How do I do that? Sorry, I only made this Profile to ask this certain question, I'm new to this, bare with me and I'll give you the +1 if you tell me how, god, I'm such a noob. -_-;
Dec 20 '11 at 02:07 AM
Hannandh
See the thumb up icon by my answer? :) That. Don't worry about looking like a noob. xD
Dec 20 '11 at 02:09 AM
Zergling103
lol ... I'll give you one also
Dec 20 '11 at 02:10 AM
Lo0NuhtiK
(comments are locked)
|
|
Instantiate takes three parameters, the object, the position and the rotation. The rotation has to be a quaternion. Is there a reason you're using the normal from hit? Otherwise switch it to Sorry, I really don't understand this, I'm just learning how to use Unity, I'm not too familiar with scripting or anything.
Dec 20 '11 at 01:25 AM
Hannandh
(comments are locked)
|

Old habits die hard, so, might as well start off doing things right and get your script formatted correctly in the code box so we can read it.
It looks right when I go in to edit it, so I don't know why it comes out like this, shouldn't be that hard to decipher...
No problem, I'll try to make it easier to read now, I completely understand what you mean, I'm asking for help so there is no need to make it more difficult on who is helping me.