Hot answers tagged

2

When you have an array of type Entity then you can only call methods on the entries which are declared in the class Entity. If you want Human and Zomby to have different implementations for that method, then you can declare that function as virtual in the Entity class. You can then override that implementation in both sub-classes. That means when you call ...


2

Yes. This is all doable. Limitations in games most of the time come from features being too heavy for the physics engine ("we can't simulate that many bodies at once, otherwise it trashed the framerate"), or simply because the feature does not add much to the look and feel of game (while taking more time from the dev team to figure out what needs to be done,...


1

It all depends on the query types, but broadly speaking... If world is very large, as in an MMO, use a database, whether SQL or noSQL style is up to you, but it is a lot simpler to read (with your own eyes) the output of noSQL DBs which serve JSON output natively (GraphQL, MongoDB). Database tech is designed by specialists to cope admirably with large ...


1

Your normals are flipped, search for shortcut or how to flip normals in Blender, that is causing invisible faces. Make sure your sword is parented correctly to the bone that is holding the sword. I would suggest setting up position for a sword in T pose and to not animate the sword position itself (this could have been the problem, as object was animated, ...


1

Your crashes is mostly because of improper handling of the object's ownership. When you add something to a collection, you should clearly understand who's owning the object. Is that handler owns the added objects now, and may delete those when time has come? Or is that handler only references the objects, and there's some other subsystem that will destroy ...


1

If it were me, working on Unity or not, I would have two classes/prefabs and swap. The idea is that the active object will be replaced with a different object that is inactive. Simple. To do that, in the event that handles the interaction with the object, you can instantiate a new object of the inactive kind, copy the transform properties (parent, location, ...


1

In this case you want to use virtual functions on the base class like so: class Entity // base class { virtual void ai(Entity n){} } Even though this is just example code, I can see that it might cause problems because you are passing by value instead of by reference.


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