+ 1
I don't know the problem here. I'm using unity and it's saying (unexpected symbol 'end of file').
using UnityEngine; public class move : MonoBehaviour{ public Rigidbody rb; void FixedUpdate () { rb.AddForce (0, 0, 500, * Time.deltaTime); if ( Input.GetKey ("d") ) { than AddForce; (0 ( 0, 500) (
12 Antworten
+ 5
Few issues, heres the fix:
Change:
"rb.addForce(0,0,500,*Time.deltaTime);"
To:
rb.addForce((Vector3.up * 500) * Time.deltaTime);
Or you can do:
rb.addForce(0,0, 500 * Time.deltaTime);
// Same result
"than AddForce(0 (0 (500)"
Now I'm really not sure what you were trying to do here, but the statement should look similar to the one you did before.
rb.addForce(...etc);
You also never really posted the whole code. So just maje sure each { has an ending }.
I also recommend you tag the question with 'unity' when you have a unity question. Just so it's easier to find for those (like me) who check to see if anyone has questions in Unity! 😛
+ 5
Can you show the entire code?
Or a high quality screen-shot works too.
+ 4
Try:
using UnityEngine;
public class move : MonoBehaviour{
public Rigidbody rb;
void FixedUpdate ()
{
rb.AddForce (0, 0, 500 * Time.deltaTime);
if (Input.GetKey (KeyCode.D)) {
/* d must be defined in Input settings for GetKey("d") to work, so I just did KeyCode.D instead, encase you haven't done that */
rb.AddForce (0, 0, 500 * Time.deltaTime);
/* Not sure exactly what this line was for, just assuming you want to add double force if d is pressed */
}
}
}
+ 2
than Addforce; (0 (0, 500) doesn't look right at all to me. than? Semicolon directly after AddForce; and doesn't look like there is a closing ) for (0 (0, 500)
+ 1
is " than" a object or should it be "else" or "rb"
0
And if I put curly braces it says (not expected).
0
Chaotic Dawg if I don't do it that way it has a bunch of errors
0
thans for helping yall
0
Ok Rrestoring faith thanks that helped a lot with some arrors but it's still saying that I need to end the file with something but when I do it says unexpected symbol. I've tried a ( } ) and ( ; )😣😣😕😕
0
haw do you do the screen-shot
0
and that's all the code I have so far.
0
thank you so much it's all go.😃😃😆😆