I want to have the following setup:
I want to rotate a sphere with the Oculus Controller by ‘pointing’ at the sphere and once I press the trigger the sphere rotates according the ‘hitpoint’ of my controller. So far I do a LineTraceForObject so I get the location of the hit result. However I cant figure out how to set the rotation of the sphere with the given hit results. Any help is appreciated.
Let’s assume the sphere is a globe and I want to rotate it with my finger (in this case the beam of the controller) in a certain direction as long as the trigger is pressed. As soon as I release the trigger, the globe should stop.
I want to touch the sphere with the beam (red) at the green point and once I press the trigger I want to rotate (as an example) in the direction of the yellow arrow. Just using AddLocalRotation doesnt work.
Yes, exactly. I click and move the sphere so it results in a Rotation of the sphere. I think I will need to calculate a vector from sphere-center to the hitpoint and transfer the rotation of this vector to the sphere, but my blueprint knowledge isn’t good enough.
Thanks, I’d appreciate. I already reached the point where I subtract the tracing point and the center position of the sphere. But I am struggling with the transfer of the rotation of the vector to the sphere.
This is excellent, almost just what I need. Instead of clicking with the mouse I want to use the controller to drag the sphere around until I release. The problem I have now (and this relates to my lack of blueprint experience) is that when picking it always snaps to the same point:
You can have another component be the one Looking at the HitLocation, and after the LookAt node executes have the sphete attach to that other component with the Rotation Rule set to Keep World. This way your other acotr snaps to look at the Hit but the sphere attaches to it right after. You can detach on release.
On the players side, there is a event dispatcher that is needed to bind the function here, this calls when LMB is released. Besides that he only checks if it has valid interface and calls it like it would any door or interactible.