#Components drawing to wrong Canvas Render Targets

1 messages ยท Page 1 of 1 (latest)

acoustic belfry
#

When the Subsystem ticks, it calls a number of Event Dispatchers

#

Update World Position gets bound inside BP_TrailDrawerComponent. That component converts its world location to an integer-based grid coordinate, then sends that new location to the Subsystem via a function. The function detects whether the component has moved to a different cell this frame, and creates new cells as needed. It also updates a variable within the custom Canvas Render Target class that indicates how many components reside within the cell that corresponds to that Render Target.

#

After that, the Subsystem calls its Begin Draw dispatcher, which is bound in my custom Canvas Render Target class to this function:

#

The "Active?" macro checks whether this Render Target's corresponding cell is occupied by at least one Trail Drawer Component.

#

The Subsystem then calls Draw Trail Stamp, which is again bound inside my Trail Drawer Component to call a function which uses the cell that component occupies to grab a reference to the corresponding render target, and initiate its Draw Texture function. This converts the component's position to the bounds of the associated Render Target (currently, these cover 1uu per pixel) and draws a texture to that Render Target.

#

Lastly, the Subsystem calls the End Draw dispatcher, which is bound in the custom Render Target class to call this function

#

The problem I am running into is as follows; my player character has 2 trail drawer components, one on each foot. He draws to the required render target (mostly) fine. However, any other instances of my character class are also drawing persistently to every render target, regardless of position.