x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Torque rotates the actor the wrong way?

In the rolling ball content pack, aren't the torque vectors effecting the ball rotation in the opposite way?

alt text

Here, the ball is rotating forward. The red line is the torque vector, pointing from the ball outwards to the right. In this scenario, shouldn't the ball be rotating towards the screen instead of away from it?

alt text

And here, the ball is rotating to the left, yet the torque vector points away from the camera.

alt text

And this is the code I used to draw these lines, same code for MoveForward. Am I missing something here?

Product Version: UE 4.20
Tags:
torque1.png (1.9 MB)
torque2.png (2.0 MB)
nodes.png (163.8 kB)
more ▼

asked Sep 08 '18 at 05:16 PM in Blueprint Scripting

avatar image

m.duman
48 3 7 13

avatar image m.duman Oct 22 '18 at 12:54 PM

Bump bump.

avatar image Steve SybrSyn Oct 22 '18 at 02:50 PM

Your reversing the roll torque and line trace direction with that multiple by -1.

avatar image m.duman Oct 22 '18 at 09:05 PM

That -1 is only there because MoveRight has its input scales the wrong way. But that information is irrelevant because reversing both the roll torque AND line trace direction would still imply that it is pointing in the wrong direction. Also just checked after reading this, MoveForward doesn't have the -1 multiplication, its incorrect as well.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You are using the 'Add torque in radians' node. The unreal documentation says this - 'Torque to apply. Direction is axis of rotation and magnitude is strength of torque.'

This means that the draw debug line is the axis about which your ball is going to rotate. Not the direction it is going to rotate towards.

Direction is axis of rotation. i.e. imagine the debug line is a pin or axle running right through the ball.

See what I mean?

more ▼

answered Jan 30 '19 at 10:15 AM

avatar image

Podgyhodgy
251 4 7 13

avatar image m.duman Jan 30 '19 at 02:27 PM

Nowhere in the post have I said the ball should be rotating towards the debug line.

The red line is the torque vector, pointing from the ball outwards to the right. In this scenario, shouldn't the ball be rotating towards the screen instead of away from it?

What I am saying is, the ball is rotating in the opposite direction than it should. Have a look at this link, if the torque vector points to the left, then you should be rotating forward. However inside of unreal, if the torque vector points to the left, you rotate backwards.

avatar image Podgyhodgy Jan 30 '19 at 03:25 PM

I beg your pardon. Perhaps this might help... Your link shows a 'conventional' right hand system. Unreal is not conventional right hand. It is a left hand co-ordinate system. If you draw some debug lines for the world co-ordinate system you can see this clearly. If you build a model in 3Dmax (right hand system) then it will appear in unreal as a mirror image (so you have to set export parameters to overcome this).
Unreal physics is also buggy/inconsistent in this respect. You can even see this in the editor where a +ve rotation about X is clockwise viewed from the origin. A +ve rotation about Y is clockwise viewed from origin. But, a +ve rotation about z is anticlockwise viewed from origin. This question from Henry Read talks about the inconsistency of the unreal system. (outstanding from 2015) I, myself am using 'add torque' to rotate a complex object about its center of mass and whilst it will complete rotations around Y and Z axes, the rotation about the X axis works halfway and then the Z co-ordinate of the center of mass starts to wander badly. In short, The handedness of co-ordinate systems and rotation systems are purely conventional and unreal uses its own conventions. Why unreal chose to do it the way they have beats me. It is a bit of a pain really.

Plus there are some gotcha style bugs in their physics I believe but that is really another issue.

avatar image m.duman Jan 31 '19 at 07:03 AM

Now I see it. Thank you for making this clear. I forgot all about the coordinate system ue4 uses.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question