How can i make this give me 360 degrees instead of 180 and -180?

I’m making an actor point to the mouse and I’m using what i have in the image but I want it to be in a 360 degree version instead of -180,180. What could I do instead to make this give me 360%'s?

How can i make this give me 360
degrees instead of 180 and -180

You’d normally add 180 to the result. But…

Here’s something I’ve been using for years and it has yet to fail me. It’s robust, and extremely flexible:

  • think of the Line Plane Intersection node as of an imaginary plane projected at location of Plane Origin (in this case our actor)
  • Plane Normal is the direction the plane is facing; 0,0,1 means it’s facing Up
  • you can then trace against that plane using World Direction and World Location - the multiplier there is the max range you want to test against

It’s a great method if you do not want to or cannot rely on tracing against geometry as there might be none available

Image from Gyazo

Consider it. Your math is flashy for sure. Is it necessary? Not so sure.


tl;dr - or just add 180

1 Like

i wouldn’t really consider it flashy, its just basic trig

also that doesn’t work, i mean it works, but it still gives me the -180 to 180 range

Add 180 then as mentioned above, that should be basic enough trig :slight_smile:

And by flashy I meant completely redundant, just did not want to say it ;p

i should probably specify this too, i need it to be on the x axis not the y axis like in real life

If you really need one 360 instead a -180, you can probably convert it using an Map Range Clamped node, so you convert -180 ~ -1 to 180 ~ 359.

Sure but why complicate things instead of adding 180?

It works with any axis. You can point the plane normal any way you want. You can even extract the normal via a regular trace. Imagine you wanted to move things perpendicularly to a point on a surface of a sphere. That works too.

It’s great for building aligned things in thin air, moving things at odd angles. You can achieve a similar effect with vector rotation since that’s what the glorified node I mentioned really is. It does the heavy lifting.

In addition you can combine it with Inverse Transform Rotation if you have multi-joint robotic limbs. Think industrial applications and kinetic hierarchy.


Apart from that, not sure what you’re going to use it for so hard to advise. Perhaps this method is useless in your case. Consider including more details.

your code does the SAME exact thing as mine.

id goes from -180 , 180 not -180,0

It does not. But I’m not here to argue or explain it further. There seems to be no point.

Gonna tap out on this but good luck with the project.

I finally created it too how I want it

Hey I’m trying to accomplish the opposite of this? I’m getting a rotator input in 0-360 and want to convert it to -180 ~ 180

Any help?

subtract 180?