Questions tagged [inheritance]
In OOP, this refers to a lower-level class using the definition for a higher-level class' methods or properties.
65 questions
2 votes
2 answers
1k views
Should a CharacterBody3D be the root of a character, or a child node?
I'm watching a tutorial on setting up a 3D player character in Godot, and at around 7:45, it shows CharacterBody3D as the root node. I'm wondering if this is ...
1 vote
2 answers
1k views
How should I implement the idea behind this abstract class setup in a Unity-Friendly/Inspector-Usable way?
First up, the name of the question is terrible and I am open to suggestions. For context: I'm still relatively new to C#/Unity and it's hard to ask questions properly when I don't know the terminology....
1 vote
1 answer
1k views
How to inherit of a scene tree structure in a way that a change in the ancestor is updated in the descendant?
Consider this structure: * KinematicBody2D (Actor) |_ AnimationPlayer (able to make a rotation of 360) Now I want to make a Player and an Enemy that inherits of ...
0 votes
0 answers
43 views
Overridden movement function doesn't work
I moved from C to C# so I am a novice in Object Oriented Programming. I wanted to implement OOP in my character movement, but it didn't work the way I expected. My character is instantiated when the ...
0 votes
1 answer
582 views
How to call StartCourotine in abstract class?
Bellow is my code. I have an abstract class and a inheriting class. This keeps giving me an NullReferenceException, on the ...
0 votes
1 answer
105 views
Best way to implement a class or interface for a set of UI buttons that only differ in their Draw() function?
I have three types of UI buttons that go on a cooldown bar: A traditional cooldown bar button where once the corresponding key is pressed, a timer shows over the button and dims the texture. A button ...
0 votes
1 answer
1k views
Heir Class Constructor Throws CS7036 "No Argument Given" Exception [closed]
I'm trying to create a class that holds the data for an an attack, called Attack. I also have special attacks that have more properties, and so I wanted to create a ...
0 votes
2 answers
305 views
C++ inheriting functions problem
So I am creating a game with C++ and SDL. I have a "gameobject" header file and no cpp (I do not need it) the game object has 2 functions void render() & ...