Hello, I have a cube on my stage and there is a UI, it changes the size of the cube, but if the size is too big, it is not in the field of view of the camera and I have to move the camera and only then it is visible on the screen, how can I make the camera automatically move away so that the cube is in the field of view of the camera? Thank you all very much in advance, I really hope for your help!
The most simple way to do it, is changing camera location based on UI value.
Can you please at least briefly tell me how it’s done?
I’m just starting out and learning.
I’d appreciate it very much.
Can you please give me your private messages on any social network or right here, I can’t write you a private message, right on this forum, to clarify something.
You are the only one who replied, can you please give me clarification if it’s not too difficult, quickly?
I made an actor named “Camera”, added spring arm to move the camera and parented camera to it.
I’m using spring arm’s “Target Arm Length” value to move the camera.
Created UI with slider and added code to it. When the slider value changes, based on it, will change the size of the box and the “Target Arm Length”.
Variables “Box” and “Camera”, in the UI code, I get from level blueprint, when creating the UI widget. I have checked “Expose on Spawn” on them.
Does the slider resize the cube or not?
I need the cube size to change from custom fields, but this is already implemented. I just need to change the camera distance to X so that any size cube falls within the camera’s field of view.
You can get cube size, and move the camera based on it.
Could you please tell me how you wrote the objects to the variable?
I can’t do the same as you where From persistance level on the first blueprint.
Its level blueprin.
Select needed object, go to level blueprint, right mouse click, and press create a reference.
Sorry, how did you create SpringArm as a variable?
And why does it look like this?
How do I access the Arm Length value of a SprinArm component?
I decided that I would just increment it after certain dimensions
I need to make it change the spring arm without slider depending on the size of the cube, will this work?
what do you mean by
Look, I need that the cube at any size, always fall into the screen, I have now so that the cube at a size of 20 units, just does not spawn, you have to move the camera itself, and I need to do so that the camera at any size, even large cube, moved away itself, so that the cube would fall into the screen and it was immediately visible
Do you change the size of the cube by hand?
The dimensions are taken from the input fields
You have this. When you change the size of the cube, change camera spring arm’s length accordingly.
Can you please show me how to do it? Sorry, I’m a total noob and I really need this.
Show me how are you changing size of the cube