Post

Visualizzazione dei post con l'etichetta collision

Collisions & Spawning a Blueprint class from C++ code

Immagine
In this post we learned about class inheritance. Another case in which this technique is used by Unreal Engine, is when we create a Blueprint class based on a C++ class. We did this for the map at the beginning, and now I want to do the same with both player and enemies starships. There are a couple of reasons why I came to this decision: 1) I want to add new static meshes to the base one, i.e. a simplified shadow under the hull, particle systems for thrusters, etc. and it would be a pain to create them all from code at right positions. 2) I want to use Blueprint Overlap Event to manage collisions between ships, so I don't have to check them from code. The problem here is that we can't simply grab the Blueprint class and drag it into the level, we need to programmatically spawn Actors from code; we don't have a reference to the BP class though, so how can we do it? Well, first of all let's create Blueprint classes derived from our PlayerShipClass and EnemyShi...