Update Instance Transform sets rotation to 0/0/0

http://puu.sh/euuST/f8450b3c60.png

Guess what the output for this is.

LogBlueprintUserMessages: P=0.000000 Y=-156.724731 R=-0.000000
LogBlueprintUserMessages: P=0.000000 Y=0.000000 R=-0.000000

Suddenly, the rotation is 0! You can’t see it in the screenshot, but location and scale is actually set correctly. Only rotation is not.

I needed 3 hours to find out why my stuff is not working! Its very annoying to have to spend so much time on finding out that some node it absolutely not doing what it should. I searched the problem everywhere in my blueprints! While using a programming language it’s normal to make stuff wrong, find what is wrong, and fix it. But actually thinking about that the programming language IS the bug, that’s the last thing to think about! How should I be able to work productive with this!?

I use 4.6.1. And no, I don’t know whether this occurs in new projects! That’s your thing to find out. Not mine. I paid for this “Engine” and if I should ever finish this game, you will get thousands of dollars royalty money. So it’s your job to give me a software I can use!

Hi ,

Just to clarify, you are setting the rotation of the LTransform variable to (0,156,0) and once the instance static mesh is moved, it prints (returns) all zero’s?

Could you provide a screenshot showing how you are triggering the setup pictured above?

The blueprint you see in the screenshot is just triggered by EventBeginPlay of the actor. The LTransform is already set before, it just uses location and rotation of the original transform of the instance and only changes the scale.
“UpdateInstanceTransform” just only applies the location and the scale of the input transform to the instance, not the rotation. I don’t move the instance, I just take the transform, and set it again to the same instance. Rotation should not change. For location and scale it works, but rotation is just set to 0/0/0.

The important thing is, the transform the instance is updated with is not the same the instance actually uses after the updating. While updating the rotation is “deleted”.

Yes, it is a blueprint only project. I have not made any code changes.

If you set rotation to 0,0,0 of course it’s still correct after the updating. The problem is, that after the updating the rotation get always set to 0,0,0. So you want to set it to 5,5,5 and after the updating it suddenly is 0,0,0.

I’ve attempted to reproduce this several times and so far I’ve been unable to get your results. You said this was a blueprint only project, correct? You haven’t made any code changes?

I set the Transform Variable’s location and scale values to something other than default but I leave the rotation value at 0,0,0. Each time I ‘Update the Instance Transform’ the rotation always reads 0,0,0.

were you able to reproduce it now?

So far I haven’t been able to reproduce it. Each time it prints out the correct values that I’ve input. It maybe something specific to your project. If you would like (and if the project is small enough), feel free to send me a download link for you project and I’ll look into it further. You can do this by private message on the forums.

I tried it in a new project and there it also works for me. I will send you my normal project in the forums. Is uploading on mega ok?

Google drive or is preferred, but you can try Mega. I’ll let you know if I can get it, sometimes our firewall will block downloads from there.

There is definitely some kind of instancing error happening. When the second LTransform is set, the rotation should not be effected.

I did notice that changing the GrowState values to larger increments made the rotation stay the same. This maybe something that you would want to test further

Default value: 10

Add amount: 1

Less than: 100

I don’t know the exact cause but I believe it is because the ForLoop is handling so much data that things are getting crossed. You may want to think about making the LTransform into it’s own array and/or handling the Scale value separately.

Take a look at this tutorial that one of our technicians made. It has a Grass Growing section this is very similar to what you are doing here.

Thanks for testing this out. I guess for now I could just scale the whole instanced static mesh instead of the individual instances, since they are all scaled with the same speed. But for more realism I may would want to add individual growing (scaling) speeds for each instance later.
Will you (or other Epic guys) further investigate why this problem occurs? I would like to hear something like “I added this as a bug on out internal bug list and our software engineers will try to find the issue when they find time for that” or something like this ^^

I guess a fix wont make it into 4.7, what’s about 4.8? I just want to hear that it will be fixed in some future release, I just had this issue again at another place. And now I cannot simply bypass this issue since I really need to scale every instance individually. And it really looks ugly that suddenly all the rotations of the instances is 0/0/0.

Hi ,

I’m still investigating the issue and I’m trying to dig a little deeper to find the exact cause. I’ll post back here as soon as I have something.

Ah great thanks :slight_smile:

Here you go, it seems that the LTransform variable being set twice was the cause of the issue. It would get the initial rotation at the loop start but it would then reset the rotation to the ‘Out Instance Transform’.

Take a look at this setup and see if it works for you. I added the NewTransform as a ‘non-local’ variable so I could set a default value for it. Version 4.6 doesn’t allow a local variable to have it’s default value set in this way (however that has now been fixed internally).

Thanks, but I have changed the whole way this growing works a lot so I cannot simply edit the function to test this. But I don’t really find the difference you made there? And I am completely sure the issue was not the LTransform variable, because I only added it for debugging, I had the issue before it existed. I normally don’t want to use any variable, I just want to get the old transform and update the transform without any intermediate variable.

I think I found what is causing the problem. I told you I have the same problem in another place, and it seems the rotation gets set to 0/0/0 only if the scale is set to 0/0/0. If I set the scale to 1/1/1 the rotation does not get affected. If I set the scale to 1/1/0 rotation gets affected. If I set it to .01/.01/.01 rotation does not get affected. So if one value in the scale vector is 0, rotation gets reset to 0.
So the rotation bug may get caused this. Is this plausible?

That was something that I noticed about the original Grow Plants function in the project you sent me. When the GrowState variable was set to 0.0 the rotation would zero out, but if a higher value was input instead, the rotation would stay the same. I’m unsure of the exact reason for that but the changes I made to the function I pictured above fixed that issue.

I’m not able to enter this is a bug report because I haven’t been able to reproduce this behavior in a new project.

Here is a screenshot of your original Grow Plants function if you would like it for reference to see what changes I made.

I think it’s obvious why your changed graph “works”. You don’t get the rotation from the instance, but from the NewTransform variable. The rotation is only set to 0/0/0 the first time the function is called (since only the first time GrowState is 0).

But the first time the function is called, the rotation is get from NewTransform, and directly again set to NewTransform. Then the instance transform is updated (and rotation get’s set to 0). But since the scale is 0, you are not able to see the changed rotation in the game (since you don’t see the plants at all).

The second time the function is called, the old rotation is still get from the NewTransform node (which has NOT been set to 0). Then the instance transform is updated, and since GrowState is not 0, scale also is not 0 and so the rotation get’s set as it should.

In my original GrowPlants function I have directly set the LTransform variable from the “Get instance transform”, so since the rotation was once set to 0 there, it always was 0 afterwards.

By the way, I can easily reproduce this in a new project. I was not able to do it before because there I have not set the scale to 0/0/0. If I create an actor with an instanced static mesh component and update the transform, I get the same bug as in my real project.

http://puu.sh/eWqc7/476813d389.png

Output is 0/55/0 and then 0/0/0.