Macros / Functions with Casting nodes?

Hey all,

Quick question about macros and functions. I’m not entirely sure how I could go about simplifying my script which uses a LOT of repetition, but uses a lot of casting nodes. I know I can easily work with variables and the like within functions, but if I wanted to be able to run a function with casting, what would be the most efficient method?

Below is a snippet of my current graph which is unnecessarily cluttered. I have a bunch of characters that I need to get / set variables from, and I’m unsure how I could do that more easily than casting to each one separately.

Thanks for the help!

not much, there are “reroute node” which you can make by double clicking on wire or create it just like any other node.

Personally i wouldn’t recommend this kind of programming, when you change variables outside the object which own it, mostly because it would get messy with any non simple project and would be hard to debug or add functionality. Here i have explanation why.

Well darn. I’m a little too deep and too late to rethink the whole logic for my project.

How would you recommend implementing a system by which looking at a character changes their attributes (rotating the head to look at the player) and causes actions to occur in the level? I essentially have a city block that’s procedurally built, and along that block walk an array of different actors. If the player looks at one of those actors (if they’re in a specified proximity to the player) then the city “shrinks” meaning the block gets shorter.

Any thoughts would be great, because the problem I’ve been stuck with is keeping everything organized and talking to each other efficiently.