[4.7.6]SetRotation on physics enabled component from Actor/Scene component bugs the physics behaviour

Branch: ‘Binary’ build from the Unreal Launcher

Build version: 4.7.6

At this point I think its probably a bug, but hopefully I am doing something wrong.

To simplify the problem lets say I am trying to rotate object towards its velocity:

So in the blueprint it works without problems: place that actor in level and shoot it, it always faces the velocity direction

But when I try to create an actor/scene component so that I can make the behavior reusable, it breaks and and creates problems, especially with location.

To replicate
Create actor/scene component and create a variable of PrimitiveComponent reference to get velocity and set rotation

Apply this scene component to the same cube and set comp reference to the cube in constructor

Place it in level and apply force to see results - rotation jittery, location not updating

The conclusion I am drawing is that when setting rotation of physics simulated component from blueprint it works fine, but when doing the same from actor/scene component it messes up.

Help?

Hey ,

I started looking into this last week, but haven’t had a chance just yet to revisit. I’ll get back to you as soon as I’m able.

Thanks for your patience.

Thanks , much obliged! I confirmed this in 4.8 preview 1 as well, and I will try to add some more details if I can

Hey ,

I wanted to give you an update. I’ve spent a little bit of time with this today and while I’m seeing different behavior between the BP component and the BP that includes this setup I’m still looking into it just a bit before reporting a bug.

I’m going to reach out to our BP team to double check a couple of things.

As a workaround for the moment, you can actually use a Macro that can be used in any actors of any classes.

All you need to use this macros is to setup a macros library BP ([documentation][1]).

When you create this Macro library you can just set it up like this:

Setup your input pins on the Input node.
Now whenever you open a BP you’ll have access to this macro to get the same functionality.

I’ll get back to you as soon as I know something more. Thanks for your patience and hopefully this workaround will get you by for the moment.

Thanks for following up ! I resolved my issue by applying physics torque on the referenced Primitive Component instead of setting its rotation. This was by design a better thing to do anyways so I am not directly blocked by this anymore. But as such the problem remains. Imagine you design a “compass” component which rotates an X axis of a mesh to North all the time, and you need to pass the reference of that mesh that needs to be rotated. This would genuinely be an issue. Additionally, I logged the speed of the target object in the console and I was surprised to see it increasing/decreasing correctly after it received an impulse. It almost creates a feeling that the only missing thing is the location to correctly update. Bottom line, setting rotation on a reference of Primitive component through an Actor/Scene component definitely bugs its location, and I would be happy to see this fixed. Thanks again and good luck!

Hey , I see you accepted this answer, did the issue get confirmed or fixed?

Nope. That’s my fault. It’s still on my list to look into. Didn’t mean to check it as resolved. Thanks for letting me know!

Oh, I got hopeful there for a second. Sorry for scrutinizing though, and thanks for all the attention you have given this

Hey ,

I’ve been trying to get this setup in a fresh project and am having difficulty getting things to work the way I had before since I’ve lost or gotten rid of the previous project that had this setup.

Would you mind uploading a simple setup with just the cubes and this that I can submit a ticket for.

Let me know.

Thanks for your patience with this one. :slight_smile:

Hey ,

You bet! No hurry to fix it, I have resolved it by using a different and more appropriate technique. I have uploaded a sample project to mediafire and dropbox, use whichever link best suits you. Here are the links:
Dropbox
Mediafire

Thanks for being awesome :slight_smile:

Hey ,

Apologies for this one falling by the wayside. I’ll update you here soon.

Any update on this? Still present in 4.7 throught 4.11P8

Hi ,

I was able to reproduce this on my end in 4.10.4 and have entered a bug report, UE-28824, to be assessed by the development staff.

SetRelativeRotation is causing a similar Physics issue as well in 4.13. Checking or unchecking Teleport has not effect. Object bounces around. Removing just this BP item causes the, in my case, Blueprint Static Mesh actor with Physics enabled to not behave properly.

Hi pjneese,

According to the bug report here, this was marked as “Won’t Fix”. Check your velocity to ensure that it is not registering as 0, it may be pulling velocity from a component that doesn’t have physics enabled on itself, which could cause this error to occur.