Rotating an object half as much as another

You need to add a Nave Mesh Bounds Volume to the area you want things to be able to navigate.

Press P to see where nav meshes exist. Should be green on the ground once you’ve added one.

Watch this tutorial: Basics of AI | Live Training | Unreal Engine

This one is also good: Getting Started with AI | Live Training | Unreal Engine

Haha, yes. I must have had them both open at the same time xD

Instead of setting the relative rotation, have you tried using Add Relative Rotation? You could, for example, add 5 degrees of rotation to one and add 2.5 degrees to the other.

I’m doing a similar thing where I try to scale the rotation of one actor based on the rotation of something else.

I ran into the exact issue you describe, and they way around this is to acquire the delta (difference) between the rotations (the rotation of the object in the LAST frame against the CURRENT frame). There is a Delta(Rotator) node you can use to acquire the delta. You can then scale this delta value and apply (add) that to the rotation of your scaled object. (E.g., the delta determines your main object has rotated by 5 degrees since the last frame, you scale this 5 degrees by 0.5 to make it 2.5 degress; you then add this 2.5 degrees onto the other object’s rotation).

However, I run into various issues with this method when attempting to scale on multiple axis (because the orientation of an object can be represented by more than one Euler representation), and I imagine it’s not possible in Blueprints (will need to make use of C++ quaternion and/or matrix math to do this effectively; I’ve attempted something with FQuats but don’t have anything that works currently).

I know it’s not much of an answer, but I hope it helps point you in the right direction. And if you do find a solution that works in UE4 then be sure to post it here because I would like to have a look!

The Problem is that you go from 359 degrees for the large rotation. 359 / 2 = 179.5, to the next frame of 360 degrees which is actually 0 degrees. 0 / 2 = 0, the shorter rotation will only go half way then snap back.

Save the difference between the two angles that are changing, and use that to add to your smaller rotation.

Here’s a link to the recreated code. [Use one angle to rotate the other. posted by BenVlodgi | blueprintUE | PasteBin For Unreal Engine 4][2]

This is exactly my solution, restructured.

Could you edit your original post with this image to show how you solved it, but mark my answer as the official answer.

Hi,

I am currently playing around with Mitchs vr following the unreal vr cookbook examples.

I am trying to make a system similar to cogs and gears in which one rotation of the small wheel will rotate the the big wheel X amount(in this case 50%). i have tried a number of methods and most end up with the big wheel rotating the required amount and snapping back to 0 degrees as the small wheel completes one rotation.

Could anyone point me on the right track,

Thanks!


Thanks everybody for the assistance with this, and pointing me in the right direction

Below is the finished graph with the scale reduction in rotation

Many Thanks to jaragoondoo, BenVlodgi and others

Thanks for the reply, although think you have posted this on the wrong question

Hi, Thanks for your reply.

I have tried doing this but I have had problems in getting the rotation to fit to the VR hand position? which is why i went with the current method(which works well with the small wheel)

Do you have any ideas on how you would overcome this?

Thanks :slight_smile: