https://community.gamedev.tv/c/200?tags=9_CB_EBF

I feel like casting here to player for each ammo pickup is expensive.

Which begs the question? When would you recommend casting?

Why cast when you could use a trigger instead?

True but we’d still need a reference to the player and see what is overlapping with it.

Btw this is from the course FPS First Person Shooter Blueprints Unreal

Unless you make it multiplayer, you can always find the player. Not an issue. So, when the begin runs on the blueprint for the pickup, you can identify the player and on overlap, check it is indeed that player

Unless you’re picking up thousands of ammo pickups per second then it shouldn’t be a performance issue. However, you should always question whether a cast is necessary.

You could actually replace this with an Interface and save the trouble of a cast.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms