I can't connect Cast to Target

I’m trying to make a score system, and the final step is to connect the Cast 2DSideScrollerGameMode to the Target. However, the program’s telling me it can’t be done.

Here’s a picture of the blueprint.

Any help or alternative to get this two connected?

The target for your Add Target Points function is “Map Gamemode”, not “2DSideScrollerGameMode”. Map Gamemode needs to be a child of 2DSideScrollerGameMode for this to work.

You could try casting to Map Gamemode instead. But it depends on the rest of your setup if that will give you the desired results.

it’s becayse “Add Target Points” is an event from “Map Gamemode” and you’re trying to conect a “2DSideScrollerGameMode” it will only work if “Map Gamemode” is parent of “2DSideScrollerGameMode”, otherwise it doesn’t even make sense, you’re trying to call an event that doesn’t exist in the “2DSideScrollerGameMode” you need to implement this event in the 2DSideScrollerGameMode too, or use the Map Gamemode and cast to it.

if for some reason you have an event with the same name in both classes and still can’t connect, grab the gamemode reference (return parameter from the cast) and type “Add Target points” to call the SideScroller’s event, the one in your blueprint is an event from another gamemode.

Fixed it! Thanks a lot!

No problem, good luck with your project!