Skip to main content
5 votes
Accepted

Does abstraction influence performance?

It looks like you don't really need to ask "Does abstraction influence performance?" - because you did one better: you tested and measured it! "The problem I am facing with version 2 is that the game ...
DMGregory's user avatar
  • 141k
3 votes
Accepted

What is the best practice for creating a system of platforms that does not use Unity's tag system?

Depending on the level of complexity required you could go one of two routes: If you have a set of GameObjects that represent the different block types and all you need are a set of properties to ...
Zhaph - Ben Duguid's user avatar
3 votes

Should a CharacterBody3D be the root of a character, or a child node?

It is purely personal preference. When I develop in Godot I take the approach "make it work then make it better". So I would probably start structuring my scenes in the simplest way possible,...
Applekini's user avatar
  • 8,543
2 votes
Accepted

Instantiating, Inheritance, Objects and Children basics in Unity

if I make a c# script "BlueEnemyScript" inherit from script "EnemyScript", that's a "child object" in c#? No, when you define something like ...
DMGregory's user avatar
  • 141k
2 votes
Accepted

Destroyed GameObject but still trying to access it(C# Unity)

I'll answer my own question . What i did here is that this line of code ...
NoobProgrammer's user avatar
2 votes

Unitys [SerializeField] and parallel inheritance

It looks to me like you might actually want an IItem interface, or abstract class, a bit like this: ...
DMGregory's user avatar
  • 141k
2 votes
Accepted

Why can't this event call its parent event?

Answered my own question within minutes of asking. How I created this problem When overriding parent events in Unreal, you must right click and use the context menu to add the event you want to ...
Natalo77's user avatar
  • 709
2 votes

RPG Item Design

Similar to the answer to the question referenced by Philipp, you might consider using a general system of events and flags for every item: CanEquip, OnEquip/OnDeEquip CanConsume, OnConsume IsQuestItem,...
jzx's user avatar
  • 3,845
2 votes
Accepted

How to inherit from a custom node of a gdnative plugin, in gdnative?

At some level we could argue for Godot being data oriented (e.g. the code inside the "servers", such as VisualServer and so on), or we can argue that the ...
Theraot's user avatar
  • 28.2k
2 votes

Making unity inspector accept classes that inherit from a base class

I'm unable to reproduce the problem described in this question when using types that are derived from MonoBehaviour or ...
DMGregory's user avatar
  • 141k
1 vote

Interactable actors should be implemented via components or inheritances?

There is another option, make all Actors implement the IInteractableInterface interface by default (and remove that interface from the hierarchy) and use a ...
ratchet freak's user avatar
1 vote

How should I implement the idea behind this abstract class setup in a Unity-Friendly/Inspector-Usable way?

One simple way to get this behaviour out of the box is to make your FieldGeneric3D inherit from ScriptableObject: ...
DMGregory's user avatar
  • 141k
1 vote

How should I implement the idea behind this abstract class setup in a Unity-Friendly/Inspector-Usable way?

One possible solution is that instead of having it as a field in this class, have it as a separate monobehaviour component that inherits from an abstract class or interface. You can then get a ...
Adam B's user avatar
  • 800
1 vote
Accepted

How to inherit of a scene tree structure in a way that a change in the ancestor is updated in the descendant?

You can make an inherited scene. From the "Scene" menu, select "New Inherited Scene…" and pick the base scene. Then apply the modifications you need (e.g. change textures). There ...
Theraot's user avatar
  • 28.2k
1 vote
Accepted

Can I add extra widgets to a child widget in UMG-UE4?

You need to use an overlay which will allow you to put multiple widgets onto one widget.
Stephen's user avatar
  • 1,040
1 vote

How to call StartCourotine in abstract class?

I'm unable to reproduce this problem. Testing with the following AbstractClass: ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

C++: Setup the basic Update function in different classes which all derive from GameObject

You'd want to use polymorphism. In your case : ...
mukuro's user avatar
  • 26
1 vote

Use GKEntity's component(ofType:) with inheritance

Well it appears as if no one here seems to know it so I'll just post what I used which is a new method that I added in an extension to GKEntity (which I was ...
lsauceda's user avatar
  • 151
1 vote
Accepted

Java: Updating entities in composite design

why don't you make lists of your interface? ...
Martin Frank's user avatar
1 vote

Best way to implement a class or interface for a set of UI buttons that only differ in their Draw() function?

If you distinguish these button types by making derived classes for each, I would have the AbilityButton class have an abstract Draw() function and each of the derived classes would then implement the ...
Zillo's user avatar
  • 131
1 vote
Accepted

Heir Class Constructor Throws CS7036 "No Argument Given" Exception

By default, when new SpecialAttack() is called, before the SpecialAttack() constructor is hit, parent constructors are hit. The ...
user134830's user avatar
1 vote

C++ inheriting functions problem

Java is object oriented, that is, it makes heavy use of inheritance, but the syntax is a little different. In C++ we declare a base class, which can be viewed as an interface, thusly: ...
Ian Young's user avatar
  • 2,694
1 vote
Accepted

C++ inheriting functions problem

In the future, make sure to write the error the compiler gives. In c++, for a function to work, you need (generally) two things: a declaration, and a definition. (In some situations, both can be ...
Vaillancourt's user avatar
  • 16.4k
1 vote
Accepted

why child class can access object while parent can't

Since I used a start method too in the child class I should have written it that way override protected void Start() { //some code base.Start(); } and in ...
Abeer's user avatar
  • 25
1 vote

XNA: Classes with Texture2D to be treated as one

You can either just extend Texture2D, which would allow you to cast it down to a Texture2D if you want or (in my opinion preferably) extend the spriteBatch with a draw that accepts Animations. To be ...
Bálint's user avatar
  • 15.1k
1 vote
Accepted

Interact with inheriting class methods from "casted" base class (collisions, etc)

In Unity, I'd generally recommend working with the principle of composition over inheritance. In this case, if player characters, enemies, and environment objects all need to take damage, then damage-...
DMGregory's user avatar
  • 141k
1 vote

How to expose a child node’s texture from the parent in Godot

Let us start with your code: ...
Theraot's user avatar
  • 28.2k
1 vote
Accepted

How to expose a child node’s texture from the parent in Godot

I would export the texture variable from the root node and simply set the child texture in _ready(), rather than mess around with getters and setters. ...
DyingIsFun's user avatar
  • 1,337

Only top scored, non community-wiki answers of a minimum length are eligible