Actor flickering, when changing its rotation

So Ive been building this building system, and therefore I want to be able to rotate walls etc. but whenever Im rotating the wall arround 180° its just flickering and I have no Idea why it is like that. Maybe someones knows something?

Thank You!

It’s rotating every frame, that’s what you’re seeing. Are you using tick to rotate the object?

I have an Input Action for my mouse wheel, and once its pressed, a boolean variable is set to false or true and this variable is used in a function that sets a rotation degree (0 or 180). This function is called in another function that is called in tick… And if the rotation degree is changed (or not), it will be added to the current rotation (The flickering also occurs, when I only rotate it once)

I actually already tested a bit, and if I remember correctly the flickering only comes, when the rotation degree is abovy 90 degree or something close to that.

Sorry for that ugly code :melting_face:

and thanks for the reply

1 Like

Sorry, I can’t really tell what’s going on from this.

But, I can tell you that it’s because the engine likes to correct +/-180 to the opposite.

Unfortunately it’s not possible to do rotation calculations by adjusting axis values individually. Things will be ok, however, if you do the math using rotator sums. So this kind of thing

would become

Either that, or

you have to experiment :slight_smile:

So Ive tried this, and its still the same…

You need more Information about what Im doing or is it just that you also have no idea why this is happening?

1 Like

All I’m seeing is disembodied bits of code.

I’m still suspecting tick… can you show how it’s involved?

That could be a rendering artifact for motion blur or some other shenanigans. Try setting Teleport to true on your set transform nodes to skip velocity updates.

1 Like

Unfortunately that didnt work…

I see what you’re saying, but…

It makes sense to have the line trace for interact-able objects on tick. But nothing else.

Somehow, I think a route in that code that shows the possible place points is running every frame, and that’s giving you the jitter. You only need to redraw the placement if the player changes socket, or orientation.

You might want to try

1 Player is just walking around, the only thing tick is doing is a line trace to highlight possible objects to build on

2 The player clicks one of these objects ( and tick stops ).

3 A mouse wheel event will show the possible sockets ( still no tick ) ( this is the object BP responding )

4 The player can place a brick or cancel

5 We go back to tick and look for building objects

You might be able to get somewhere with careful placement of DoOnce nodes, but I think separating the code would work better.

Tick is for stuff that needs to happen every frame. The only thing you need to happen every frame, is the line trace for build-able objects.

Does this make any sense? Unreal is an object orientated engine. What you’re doing here is a bit like procedural coding ( like Fortran ). All the code in once place, which is a nightmare to manage.

Thanks for the advice, I will definitely try that

1 Like

Here, this sort of thing

Incredibly basic, all in one BP. I have used scenes instead of sockets. If you did this seriously, the mounted mesh would be separate, of course, and would probably place itself at the required location. And, as you can see, both the pieces of code are basically the same. So no code to talk of ( and no tick :wink: ) but

build