Bug in "MoveTo" node or pawn sensing component

Hi All

Recently I reported what I believed to be a bug in “MoveTo”;

I debugged this by creating a debug character class, debug AI class etc and then testing each part of my character class independently.

It turns out that a component of my character class is interfering with either the sensing component or the MoveTo node. If I run the same logic on the character without a custom component on it, it works fine. The component inherits from UStaticMeshComponent and has delegates on it which trigger functions in the character class. These components are attached to sockets on the mesh of the character.

This would seem to be a bug.

This is the header file in the custom class;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam (FSensorStartHitSignature, USensorMeshComponent*, HitSensor);

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam (FSensorEndHitSignature, USensorMeshComponent*, HitSensor);

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam (FSensorInteractedSignature, USensorMeshComponent*, HitSensor);


UCLASS(ClassGroup=RiverRises, meta=(BlueprintSpawnableComponent))
class RRDEVELOP_API USensorMeshComponent : public UStaticMeshComponent
{
	GENERATED_BODY()

		
public:

	USensorMeshComponent(const FObjectInitializer& ObjectInitializer);
	UPROPERTY(BlueprintReadOnly, Category = "SensorMesh")
	FName SensorName;

	UPROPERTY(EditDefaultsOnly, Category = "SensorMesh")
	ESensorType SensorType;

	UFUNCTION(BlueprintCallable, Category = "SensorMesh")
	float GetClosestPoint(const FVector & Point, FVector& ClosestPointOnCollision);

	UFUNCTION(BlueprintCallable, Category = "SensorMesh")
	void OnSensorBeginHit(class USensorMeshComponent* HitSensor);

	UFUNCTION(BlueprintCallable, Category = "SensorMesh")
	void OnSensorFinishHit(class USensorMeshComponent* HitSensor);

	UFUNCTION(BlueprintCallable, Category = "SensorMesh")
	void OnSensorInteracted(class USensorMeshComponent* HitSensor);

	UPROPERTY(BlueprintAssignable, Category = "SensorMesh")
	FSensorStartHitSignature OnSensorStartHit;

	UPROPERTY(BlueprintAssignable, Category = "SensorMesh")
	FSensorEndHitSignature OnSensorEndHit;

	UPROPERTY(BlueprintAssignable, Category = "SensorMesh")
	FSensorInteractedSignature OnSensorInteractedEvent;
};

EDIT: It turns out that the components and bindings in the character class are ok, they don’t affect “MoveTo”, until a StaticMesh asset has been assigned to them in the editor. Once a mesh has been assigned, the character starts juddering from side to side, whilst making progress towards its target.

Hello robbiecopper,

As the issue could lie in the code itself and what logic these delegates are calling, can you provide a copy of the project? If it is too large, code files could do as well but the project would be more helpful if possible.

I’ll send you a link on your forum account, thanks

Hello robbiecooper,

Thank you for sending a copy of the project. Was this project compiled on a source build of the engine? I was prompted to pick an engine version when attempting to open it which would point to me not having the same version of the engine that you’re using. This ended up in me needing to recompile the project (I selected 4.8.3). When attempting to recompile, it fails with multiple errors. If it is a source build, were there changes that you made to the source code that your project may be dependent on?

Hi
Ok, its 4.9 github version. Sorry, forgot there’s ENGINE_API on all the virtual functions in AmbientSound.h and also on FindAndCacheLevelStreamingObject in LevelStreaming.h.

By the way, I think the problem is with the INavRelevantInterface. Thats a guess, but the character is switching from side to side, which thinking about it, could be the navigation trying to “walk around” the static meshes.It gets about half way through a step and then switches sides.

I would like to put a bug report in for this issue but for that I’m going to need to be able to reproduce the issue. From this situation, I’m not sure of everything that needs to be commented out in this project to make it compile as I’m not sure what all of the changes were that you made to your source code. Would it be possible to either let me know what lines to comment out or provide a project that will compile on a non-modified engine? Without seeing the problem for myself and being able to attempt to debug it, I can’t proceed.

Ok I’ll modify it so that you can just open it and immediately reproduce the issue, will send a link later today. Thanks

Hey just wondering- did you get the updated project, sent a link on your forum account?

It sounds like the content folder isnt in it- I sent the content folder in a separate link initially- that wont have changed. Just copy the content folder or redownload it in the link in the first message…

Ok. Not sure why that would be the case- I set it to use the day_one map and it should just work when you press play. Tell you what- how do I use the INavRelevantInterface to tell the navigation system that the static meshes assigned to the components on the character are not relevant for navigation? If I can do that and it works I’ll change the title of the question…

Something aint right. I sent you the wrong version of the project because the behavior is similar to the version of the project that I copied in order to make the error repro version. But I have no idea where the white wall comes in to it…

Yes, I received it. I responded to you in a private message but I’ll just copy and paste it here. I do not see the character however when I press play. To be exact, when I press play I’m looking at a wall in a white room and unable to move the camera. If I right-click, the map changes to the “Day One” map but it doesn’t seem to have a character in it. Looking through the content browser, I found the “DebugCharacter” blueprint and dropped that into the level. It walks towards me but doesn’t have any odd movements. Is there another character that should be used?

For future reference: When sending a project, you can remove the Binaries, Intermediates, and Saved folders to save space. The Intermediates and Binaries folders can sometimes take up more than 80% of the entire file size. These can be recovered by the person who retrieves the project when they receive it by generating the project files and recompiling the project.

The content folder has been copied over, as it has all of the blueprints and levels in the project. The problem is that there are a multitude of assets in that list and I’m unsure of which one is the character that is exhibiting the issue, as your initial reproduction case of just hitting play is not occurring.

Edit: This could be the issue, if the character’s blueprint is called NewTestPlayerCharacter

66398-rrdevelop+error.png

I’m going to make a new version of it and send another link- I’ll just isolate the bit thats causing the problem…

Ok I’ve reproduced the issue in a MUCH smaller project. Uploading now- I’ll send you a link on the forum

Thank you Robbie, that reproduced the issue immediately. I’ve placed a bug into our system with the project attached under the number UE-23226. I’ll be sure to let you know when any updates have been made to it. In the meantime, unfortunately, I’m not sure of any workaround you can use for now.