How should i go about creating a trending curve from a proximity value with a diegetic-interface?

I need to make a trending curve for a handheld scanner and that scanner works as HUD aswell. The scanner will show a trending curve of an object how close it is located = closer the object the higher will the curve go.

How would one go making this kind of complex system?

The curve will update for like once per 2 seconds or something in that line (easily changeable so it doesnt matter).

So how would you do this:

  1. There is an “toxic” object in the game space somewhere
  2. Something calculates distance to the toxic source and saves a value
  3. The value will be visualized into the handheld scanner screen with a black pixel in height determined in the distance value.
  4. Handheld scanner will fetch this value for every 2 seconds and draw a new black pixel next the last on right.
  5. By doing so you would get a “snake” like trending curve to draw a graph of where this object is located and you can pinpoint where in the map this “toxic” object is.

Also how do you make it so that the graphic is updated on the handheld scanner screen?

This is troubling me alot and the helper is most likely going to get something for the help :slight_smile: (something just to show my appreciation)

Diegetic interface is just like in Dead Space that health bar system in back of the character and in this case it should be on the scanner we pick up from a table!

You could do this using CanvasRenderTarget2D. I’ll show you a basic version below which should give you some ideas.

  1. Make a new Blueprint Class, and choose CanvasRenderTarget2D as the parents class. Mine is named BP_CanvasRenderTarget

  1. In that Blueprint, add the below nodes. Add two float variables, Width and Height. And add a float array with 20 elements, changing the amount of elementscontrols the ‘granularity’ of the graph.

  1. Make a new material, mine is called ScannerScreenMaterial. In it, add a texture parameter named TargetTexture. Give it the default texture, and plug it into Base Color.

  2. Make a new Blueprint actor. Mine just has a cube mesh (Named “Scanner”) that I will apply the above graph material to.
    Also add a material instance dynamic variable, called ScannerMaterial. Add two float arrays, once called Distances, and one called ShiftedDistances, make sure both have 20 elements. Also add an Actor variable, and make it editable, this actor will be the actor whose distance to you will be checking. You need to set this from somewhere that makes sense for you project, for me for testing I just used a random object in the scene, and set it in the details panel in the level.

Construction script:

The Parent material, is the material you made in the previous step.

Add the above on begin play. The Canvas Render target class should be the BP you made in the first step. The time on the function will control how often the graph updates.

Then create a custom event that matches the name in the time, “UpdateScan”. And set up the below:

Note that you will need to set a max and min distance that makes sense for your usage.

Example working below. I was using that cube as the target actor:

Animated: Imgur: The magic of the Internet

No problem, let me know if you encounter any problems.

That. is. brilliant! I will test those out and try to bring my project to an end… I will get back to you! You have been a huge help!

I started putting things together and got little confused of where some of the variables are meant to be and now i get reference errors… doh!

I think the problem is in my material… settings it up is weird.

I made a instance from the material to create MyRenderTarget with “TargetTexture” ticket.

I’m definitely doing something wrong here haha… but i was able to get something to “Render Target” slot atlast.

So many nodes and things to play with so i got little confused and now i cant use render target as Target.

Also

Hey, here is the project with my setup in it for you to take a look at.
The relevant files are in the Draw folder in the content browser.
https://dl.dropboxusercontent.com/u/143773194/Projects/Draw.zip

edit: Your RenderTarget variable needs to be of type BP_CanvasRender, or whatever you named your custom CanvasRenderTarget2D blueprint class

I will look at your project and inspect… meanwhile:
I named it same as you did in the example but i cant see it?

EDIT: UE is throwing an error with the project :confused: EDIT2: I need to update…

129783-error.png

Not the texture, the actual variable type. Yours is set to Texture, but it needs to be BP_CanvasRenderTarget