❔ I need help for my Game

Can everyone help me with my game for my school project, I need help with the scripting? My Code doesn`t work.
29 Replies
Thinker
Thinker2y ago
Post your code and any errors you have
simonfendt211
simonfendt211OP2y ago
simonfendt211
simonfendt211OP2y ago
simonfendt211
simonfendt211OP2y ago
Thats my code and the errors I have
ero
ero2y ago
you have 2 Character classes
simonfendt211
simonfendt211OP2y ago
Wich one should i delete
ero
ero2y ago
how should we know?
simonfendt211
simonfendt211OP2y ago
Where is the other Caracter?
ero
ero2y ago
also impossible for us to know
simonfendt211
simonfendt211OP2y ago
or where did i code this
Thinker
Thinker2y ago
What other scripts do you have
simonfendt211
simonfendt211OP2y ago
2 other scripts
simonfendt211
simonfendt211OP2y ago
but is only one for this Charcter
simonfendt211
simonfendt211OP2y ago
I deleted the other script but now it has another error
simonfendt211
simonfendt211OP2y ago
but why it has an GetComponent the GetComponent exists why is that an error😢
ero
ero2y ago
can you please just share the code where this occurs... we can't just guess
simonfendt211
simonfendt211OP2y ago
Thats the code
simonfendt211
simonfendt211OP2y ago
Do you know now?😅
ero
ero2y ago
i don't, sorry. i don't do unity
simonfendt211
simonfendt211OP2y ago
ok
TheRanger
TheRanger2y ago
try rb = gameObject.GetComponent<Rigidbody>();
simonfendt211
simonfendt211OP2y ago
That doesn`t work
Thinker
Thinker2y ago
If you look at the script on the right, the Character does not inherit from MonoBehavior Again you for some reason seem to have two Character classes
TheRanger
TheRanger2y ago
weird it inherits from here
Cattywampus
Cattywampus2y ago
it's a common mistake it's likely you have another same script in your project
simonfendt211
simonfendt211OP2y ago
It works the MonoBehavior was the problem
Cattywampus
Cattywampus2y ago
OR you have the same class BUT the name of the file is different than the name of the class in it which also probably has the same class name as your other script in Unity for MonoBehaviors you can't have a class name different than the file.cs name
simonfendt211
simonfendt211OP2y ago
Thank you so much guys😁
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server