UpdateInstanceTransform makes all other instances disappear or move in Android packages

In our project, we will have many identical static meshes which are being handled by an instanced static mesh component. However, one type of mesh can be triggered to move. An actor, hidden in game, exists for each instance of this mesh. The actor has a component with an OnUpdateTransform method which calls the instanced static mesh component’s UpdateInstanceTransform with the instance index of the actor’s parallel instanced mesh. See code below. This causes the instance to mirror the actor’s movements.

This works as expected in PIE (with and without Android set as the preview platform, unlike the bug mentioned in https://forums.unrealengine.com/t/ue-5-4-facing-a-bug-relating-to-ism-on-android-platforms-and-android-platform-preview/1826137 ). It also works as expected in win64 packages. However, in Android packages, every instance OTHER than the instance index passed to UpdateInstanceTransform is also affected. Either they disappear, or their transform is updated in the same way (it’s hard to tell).

Does this happen to be a known issue, or is there something that can be done to fix it?

Thank you!

#pragma once
 
 
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "ISMUpdaterScene.generated.h"
 
 
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent))
class ISMUpdaterScene : public USceneComponent
{
	GENERATED_BODY()
	ISMUpdaterScene();
 
	virtual void OnUpdateTransform(EUpdateTransformFlags updateTransformFlags, ETeleportType teleportType) override;
 
public:
	//Reference to ISM Component
	UPROPERTY(EditInstanceOnly)
	UInstancedStaticMeshComponent* m_grateInstancedMeshComponent = nullptr;
 
 
	//Instance ID for ISM mesh instance
	UPROPERTY(EditAnywhere)
	int32 m_instanceID;
 
 
};
 
------
 
void ISMUpdaterScene::OnUpdateTransform(EUpdateTransformFlags updateTransformFlags, ETeleportType teleportType)
{
	FTransform xform = this->GetComponentTransform();
 
	Super::OnUpdateTransform(updateTransformFlags, teleportType);
 
	if (m_grateInstancedMeshComponent)
	{
		m_grateInstancedMeshComponent->UpdateInstanceTransform(m_instanceID, this->GetComponentTransform(), true, true, teleportType != ETeleportType::None);
	}
}

Steps to Reproduce

  1. Add mesh to instanced static mesh component, note the returned instance index
  2. Store a reference to the instanced static mesh component and the index
  3. Have multiple instances in the instanced static mesh component
  4. Build and play Android game
  5. An actor moves, which calls UpdateInstanceTransform on the stored instanced static mesh component for a specific instance index
  6. The specific instance on the instanced static mesh component is updated as expected. However, every other instance either disappears or updates to the same transform (unclear)

Hey Folks, is there any additional info that would be helpful for triaging or investigating this issue? We are attempting to optimize some content authoring tooling and it will rely heavily on ISMs and UpdateInstanceTransform. Thank you!

I’ve attached two videos, one from the editor showing UpdateInstanceTransform working as expected, and the other from an android build showing all of the instanced meshes either disappearing or moving to the same spot.

Hi Connor,

We are not currently aware of this issue. Thank you for bringing it to our attention. Can you confirm NDK version you are using and if you’ve tested it against other versions? Are you able to provide the project used to generate the videos so we can further investigate?

Best regards.

We are using NDK version 26.0.10792817, or ndkapilevel android-32. We have not tried other ndk versions yet, I will try to set that up. I will also try and set up a vanilla unreal project that reproduces the issue.

We are on Unreal version 5.5.3

Thanks Connor. We’ll await a follow up from you.

Best regards.

Hi Connor,

Sorry to hear is wasn’t reproducing in Vanilla UE. If there’s any additional data you encounter that points back to the issue lying in vanilla behaviour, please reach out again. The fact that you are not seeing the issue in PIE with mobile preview enabled but seeing on target is perhaps pointing to a vanilla issue that’s only uncovered under the specific conditions of your actual project. If you have a chance, it may be worth trying against a new NDK and perhaps on iOS in case it helps further isolate the issue, should it not lie in local modifications to UE,

Best regards.

I ended up setting up an unreal project using vanilla Unreal 5.5.3 to send your team, but was unable to reproduce the issue there. This unfortunately leads me to believe that the issue must be from one of our engine modifications, so we will investigate internally.