Hi, I am new to UE4. I’ve been using it for about a week now.
I would like to get the community’s opinion on the separation of blueprint logic with respect to casting and blueprint to blueprint communication. The UE4 docs on blueprint communication suggest using casting in the following scenario
You have a character interact with an Actor in your level and in turn causes a change to the character in some way.
Player picks up a health pack in the level, restoring health in the player character.
Enemy walks in snow or mud, causing their movement speed to slow down.
The scenario is as follows from the UE4 document on Casting
In this example we allow the player to shoot an object, making it smaller each time it is hit. Each time the object is hit, it also notifies the Character Blueprint and increases the player’s movement speed.
The document describes adding an event to the bullet blueprint and casting to the cube and player to effect a change in the objects. The cube is transformed and reduced in size. The Player receives an increase in speed. This is all done inside the bullet blueprint. I found it strange that they would embed this logic in the bullet blueprint. This seems like a poor design to me. (Question 1) Would it be better for each component to specify what should be done when hit by a bullet? If not it seems like the bullet blueprint hit logic would become unmanageable as you create a large number of object types with different behavior. Or maybe it would be better to use an interface.
Also consider a scenario with a blueprint class derived from Actor called Car and it is composed of child component actors such as the wheels and frame. (Question 2) If the bullet hits the wheel I believe the two components in the hit event will be the wheel and bullet. Should the wheel cast to the parent blueprint to adjust a car wide effect in addition to the specialized effect within the wheel?
Thanks for your input.