I’m a beginner UE4 user. I am on a blank project and i place a cube in the floor. my need is to press one key input and the box want to lift from the old position to new position and again i press the same key, box move back to the same position. Same one another key pressed to rotate the cube continuously, and can control sped of the rotation , again the same switch press back to the same rotation value. Same in scale property of the cube. Need a Blueprint nodes to do this type of motion when i play the game.Please give me a solution to solve my issue ASAP.
The nodes that would probably help you best are set actor rotation, set actor location, either world or local. Depends exactly what you’re trying to do. You may also be looking to use a flip-flop node. It’s hard to say without more specifics. There is also set actor transform, which allows you to do location, rotation, and scale. You can do these in world space or local space.
In detail, when i press a R key the cube has to rotate in its z position and when i press again it has to stop. as i’m a beginner in ue 4 i don’t know to connect the nodes in the proper way it works.
Can you please help me to learn the ue 4 and add me as a friend in epic account ??
You’ll probably want to go through some YouTube tutorials, as there’s a lot to Unreal and it depends exactly what you’re trying to accomplish. There are loads out there that cover the basics. For things like an object’s location, orientation, and changing them, there are a few things to think about. One is how much you want to move or rotate something in every frame. On a character blueprint, you’ll find a float variable called Delta Seconds in the event graph. So let’s say you want to rotate something 5 degrees. You also need to decide how quickly you want to do this. Delta Seconds tells you how many seconds have passed since the last frame. So, for example, if you want to rotate something 90 degrees in one second, you’ll be doing that over many frames at a rate of 90 (or -90 to go the other direction) multiplied by Delta Seconds. Nodes like Set Actor Location and Set Actor Rotation will instantly set the blueprint’s primitive component (a box in this case) to that location or rotation in world space. If all you want to do is add some yaw, you’ll simply be adding some value to the Z axis, but it’s better to do that in local space so you don’t have to go through unnecessary conversions. Rather than using the Tick Event to drive this, add a timeline that you can conditionally enable and disable by pressing R. This should all be pretty straightforward in blueprints. You might also look into nodes like Add Actor Rotation or Add Actor Offset.
It’s good to get a basic understanding of how all these things are operating: you’re moving objects around in a coordinate system, and you can use that coordinate space to do it or you can use the Actor’s local space (it’s own coordinate system, depending how it is oriented at that moment) and let the engine figure out what that would be in world space. The problem you’re trying to handle shouldn’t be too hard, but if you feel you’re struggling with it, going through some tutorials will get you a long way.
Also, nodes like Draw Debug Arrow are very helpful for checking to make sure you are working with the right vectors. Your actor will have an up, right and forward vector. Each is a unit vector, meaning it has a length of 1. Multiply those vectors by something like 100, draw a debug arrow with the actor location as the starting location and the actor location plus that multiplied orientation vector as the ending location. Do this for all three orientation vectors. This is a good habit to get into if you don’t yet have an intuitive understanding of how vectors and rotations work. Then when there’s some spatial math operation you want to carry out, you can check it visually to see if the math is right or not.