❔ 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.
T
Thinker•398d ago
Post your code and any errors you have
S
simonfendt211•398d ago
S
simonfendt211•398d ago
S
simonfendt211•398d ago
Thats my code and the errors I have
E
ero•398d ago
you have 2
Character
classesS
simonfendt211•398d ago
Wich one should i delete
E
ero•398d ago
how should we know?
S
simonfendt211•398d ago
Where is the other Caracter?
E
ero•398d ago
also impossible for us to know
S
simonfendt211•398d ago
or where did i code this
T
Thinker•398d ago
What other scripts do you have
S
simonfendt211•398d ago
2
other scripts
S
simonfendt211•398d ago
but is only one for this Charcter
S
simonfendt211•398d ago
I deleted the other script but now it has another error
S
simonfendt211•398d ago
but why it has an GetComponent
the GetComponent exists why is that an error😢
E
ero•398d ago
can you please just share the code where this occurs...
we can't just guess
S
simonfendt211•398d ago
Thats the code
S
simonfendt211•398d ago
Do you know now?😅
E
ero•398d ago
i don't, sorry. i don't do unity
S
simonfendt211•398d ago
ok
T
TheRanger•398d ago
try
rb = gameObject.GetComponent<Rigidbody>();
S
simonfendt211•398d ago
That doesn`t work
T
Thinker•398d 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
classesT
TheRanger•398d ago
weird it inherits from here
S
SlimStv•398d ago
it's a common mistake
it's likely you have another same script in your project
S
simonfendt211•398d ago
It works the MonoBehavior was the problem
S
SlimStv•398d 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
S
simonfendt211•398d ago
Thank you so much guys😁
A
Accord•397d 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.We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
51KMembers
View on DiscordWant results from more Discord servers?
More Posts❔ Microsoft.XmlSerializer.Generator causes failure to load assembly System.RuntimeHey all, as a way to get my program running under NativeAOT I've been looking into the Microsoft.Xml✅ Make method implemented in interface accessible from implementing typei have an interface ```csharp
interface ICL
{
public IEnumerable<ICLPlatform> GetPlatforms()
{
❔ ASP.NET, MongoDB, C#does anyone have experience with c#, mongodb and ASP.NET? I have a project and I need to get data to✅ Is there a working code editor for blazor server?i found one for blazor wasm https://github.com/serdarciplak/BlazorMonaco but that one does not work ✅ Multiple inheritance questionI have a partial class webform that is inheriting a base page class. Inside it there are multiple re❔ How to automatically set version of project to know what version deployed on specific server?The problem is that there is bunch of clients with different versions of .net core and netfx projecthow to make a target that will disappear after shooting a couple of times this is my scripts i havebut it doesnt seem to want to destroy https://paste.mod.gg/mppnwkqnmukq/2❔ ✅ Choosing an appropriate data structureSo I have a list of objects and I want one in the list to be active and the rest to be inactive.
I ❔ Saving User DataI have it set up through properties, but I'm having a lot of trouble with showing it on other forms Unsupported statement value type: Microsoft.DotNet.DesignTools.Client.CodeDom.CodeBodyTextStatementhttps://github.com/Jordan-Belfort-88/Audio-Player-1.0/blob/master/Audio%20Player/Form1.Designer.cs
IAssert.Raises<> in xUnitI'm trying to create tests for certain events. However it seems that xUnit assumes that I use EventH❔ I have an API function and I want to know what exception it can throw. How can I do that?This is not said in the documentationAmbiguity between 2 things idk how to fixGot an error message all of a sudden saying this when everything was working perfect before so i und❔ Problem populating DatagridI'm trying to populate a datagrid where certain columns are populated with information that is read ❔ Avisynth script maker thingIm trying to make a script that creates AVS files for every file in a Directory based on a template.❔ How to work with Hwnd in c#I want to open programs using Process.Start but all those programs have empty MainWindowHandle and M❔ VS For Mac Code CoverageHas anyone figured out how to show which lines are covered after running unit tests in VS For Mac?✅ Run code in main thread after Task.Run completed?Hello, I have a long running void function that I execute in a separate thread by calling `Task.Run(❔ methodHello,
If I create a method, does the method know about things in the Main method? Or am I supposed ❔ Project structure1. In my Solution there should be only 1 Project right? Unless its a big App
2. I started using fo