I don't know the problem here. I'm using unity and it's saying (unexpected symbol 'end of file'). | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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) (

20th Sep 2017, 10:04 PM
Taylor Hupp
12 Answers
+ 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! 😛
20th Sep 2017, 10:44 PM
Rrestoring faith
Rrestoring faith - avatar
+ 5
Can you show the entire code? Or a high quality screen-shot works too.
21st Sep 2017, 1:49 AM
Rrestoring faith
Rrestoring faith - avatar
+ 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 */ } } }
21st Sep 2017, 2:19 AM
Rrestoring faith
Rrestoring faith - avatar
+ 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)
20th Sep 2017, 10:19 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
is " than" a object or should it be "else" or "rb"
20th Sep 2017, 10:20 PM
sneeze
sneeze - avatar
0
And if I put curly braces it says (not expected).
20th Sep 2017, 10:09 PM
Taylor Hupp
0
Chaotic Dawg if I don't do it that way it has a bunch of errors
20th Sep 2017, 10:51 PM
Taylor Hupp
0
thans for helping yall
20th Sep 2017, 10:52 PM
Taylor Hupp
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 ( ; )😣😣😕😕
21st Sep 2017, 1:46 AM
Taylor Hupp
0
haw do you do the screen-shot
21st Sep 2017, 2:03 AM
Taylor Hupp
0
and that's all the code I have so far.
21st Sep 2017, 2:07 AM
Taylor Hupp
0
thank you so much it's all go.😃😃😆😆
21st Sep 2017, 3:05 PM
Taylor Hupp