Hello ue4 users,
Is there a way in blueprints to convert a world rotation to local and visa versa?
Hello ue4 users,
Is there a way in blueprints to convert a world rotation to local and visa versa?
All Actors have the possibility to move in World Location/Rotation and Relative Location/Rotation. With relative you will move relative to the closest parent.
Is it the Relative Location you want to use?
You can also use the Offset Location/Rotation to add from your current location/rotation.
I want to rotate a object 90 and 45 degrees based on the position that they are in. So if the parent rotates, i still can rotate the child locally.
Yes, i have that all ready, but if i change the rotation of the parent in game, the child object doesnt go to the angle i expect.
Ok, so you simply want to add 90 or 45 degrees to the current rotation?
If the object is at 15 degrees and you want rotate 90, then you want to have a solution to end up at 105 degrees?
You then could: Get World Rotation → Add 90/45 → Set World Rotation (with the output of the Add Action as new rotation.
You could break the Rotator to access a specific Axis if you want to. Then you do the Add 90 or 45 to the specifik axis value and make a new rotator.
Hm, it’s a little hard to see what you want to achieve based on the good/wrong pictures. Is it like suppose to move like a shopping trolley?
Not really, the base is what is moving. The base moves when the wheels are in 1 position, so they turn with it. and when the base is in an other position the wheels still need to be able to be pointed back forward.
Sorry, I don’t get what you are trying to achieve.
Will leave it to someone else.
That is exactly what i try to do
I’m not using the vehicle blueprint for this, because it was not predictable.
instead this is what controls the wheels.
Ok, I need a screenshot of your vehicle blueprint (the component tab) because how you have parented the components is fundamental.
Ok, glad to see timelines. How your wheel are connected to the frame? That’s important because when you move the frame you want to be sure the wheel keep the same rotation.
They are a parent of the object i’m turning
Ok I made some tests (I’ll attach the test project)
tell me if it does what you want to achieve:
P.s: obviously the graphics are proportionate to the size of the file :V
This is not completely what is meant. I have wheels that can be in 3 states. 0 degrees forward, 45 degrees and 90 degrees. My problem is that when i rotate the parent, i have no reference any more to what the 0 or 90 degrees are for my wheels.
Uhm I see now you don’t have any variable output from your timelines. Examining your last screen I notice that you use timelines as stoppable delays. Add a float variable in the timelines and connect the new output pin to a Set node for record your rotation. In this way you should have access to the rotation at any moment getting that variable. This don’t solve the problem but could be part of the solution. I attach you an other image to be sure I’m understanding what you want to reach:
I have figured it out, i wasn’t using the relative rotation to compute the relative rotation of my wheels. many thanks for you’re time
Well, good to you! You are welcome! (put your comment as answer, keep the answerhub in order ).