Hey all! I’m currently trying to implement a photo capturing component in my game, and found this tutorial for UE4 that covers the same topic. I’m using UE5.3, and while there were some differences particularly with configuring input, I managed to follow along and get it working up until now.
The first section of this part covers creating a Scene Capture Component and looks like it works and is writing to a Render Target, which I followed along and works great)
However, the next section of the tutorial where we Create a Render Target and set it to the Texture Target, as far as I can tell I am following along exactly, but it is not storing.
I hoped that it was simply something that would be fixed later in the tutorial, but after following all the way through to the end of the next part, i found that it is still only saving blank captures? I’m not really sure and can’t figure it out with my limited knowledge. Interestingly enough though, the animation that was added does display an accurate screenshot when I take it, it just doesn’t seem to save it anywhere?
Also worth mentioning i have been mousing over the rendertarget in the contentdrawer in order to update the thumbnail each time i go to check, since I know that will be asked. Any help or alternatives would be appreciated!
When you do Create Render Target, it will create a new instance render target, and when you set that value to that of your scene component, it actually switching to a new render target. Therefore not affecting your file asset “CurrentPhotoRenderTarget”.
In short it like you switch a new texture(in this case from the ram and not in the actual file).
Okayyyy, I think I understand what you mean now, in that the part I showed isn’t actually writing any values to the CurrentPhotoRenderTarget. I’ve changed the blueprint around like so, and followed the rest of the tutorial up to having the gallery on screen, but it still doesn’t seem to actually save any of the images as a new instance? I’m not quite sure how to explain what I’ve done so I’m just going to attach some pics of the blueprints.
I’ve gone ahead and rerun through the tutorial from scratch a couple of times now, and I’ve added some print strings at the end of each series of functions, along with at various points in the middle, and they’re all returning as expected, so I’m unfortunately out of ideas for myself.
As far as I can tell, the blueprint should be doing something like:
Possess Photo Mode Cam on “C” keypress
LMB press creates render target, sets scene capture to overwrite texture target, creates Photo Display widget, captures scene, adds widget to viewport, then Calls and Sets TakenPhoto event with the texture target.
TakenPhoto Event adds the texture target to the Gallery Array
G Keypress runs the Gallery widget, which runs the Individual Photo widget for each texture target stored in the array and adds them to the wrap box for the Gallery Widget, until finished, at which point it displays.
I have a feeling the issue is something to do with creating instances of the Material for each texture target, but I don’t know enough to narrow it any further than this. Sorry if my terminology is confusing, I’m still trying to get a hang of Unreal but am simultaneously trying to get this working for a school project