Is it better practice to cast from player to pickup or vice versa?

For example a health pickup, should I create the script from the player or the health pickup blueprint?

You could go either way but in my opinion, I would script it in the health pick up. Assuming you have comparatively more “pick up items” than “characters” it would be easier to cast TO the player since there would be only one of them than to cast TO each pick up from the player.

Care to explain?

Parent-child hierarchy also improves efficiency.

For example, you can create a “parent” character BP, then add all common functionality and variables that ANY character you create would need like “health, energy etc”. Right click on the BP in the content browser and find the option to “create child”. A new BP is created that is a child of the “parent” which means all the variables you created in the parent are “editable/modifiable” in the child. So you can have 10 characters with different health/energy/speed/etc but only script the logic for how health is increased or decreased ONCE in the parent blueprint. So if you want a health pick up to add 10 HP to any character that overlaps it, in the character parent BP you would script the logic to add 10 pts of health to the health variable. This would then automatically pull the child health and add 10 pts to it depending on the specific child character BP that overlapped the health pick up. This also works the other way, you make a “parent” item and script the logic for “overlapping the player” and each child you create from that already has the same overlap logic but you can assign different values to increase health or decrease health, or add energy etc. Make sense? This allows you to “cast to parent BP” and easily access those variables stored there while allowing them to be different for each child. It saves casting to each different type of character or item. Casting once to the parent will automatically pull the child’s set variable values.

Oh! I had used this method for enemy types… Thank you for the reminder, I will take note!

To add to whats been said i would also have the pickup call an event on the player. So if you wanted to add health tou would call a add health event on the player and have a input oarameter for how much health to add. This way you dont need to duplicate scripts and also its a good idea to have script that changes the player located withing the player.