Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delegate assigned to the wrong trigger component #1

Open
Nahor opened this issue Mar 20, 2023 · 3 comments
Open

Delegate assigned to the wrong trigger component #1

Nahor opened this issue Mar 20, 2023 · 3 comments

Comments

@Nahor
Copy link

Nahor commented Mar 20, 2023

Trigger1->OnComponentBeginOverlap.AddDynamic(this, &AFixedCameraTrigger::OnTriggerBeginOverlap2);

The delegate is created for Trigger1 when it should be Trigger2 (delegate for Trigger1 being created one line above, L57)

@gerlogu
Copy link
Owner

gerlogu commented Mar 20, 2023

Hi!

First of all, thank you for your remark 😊

On the other hand, well, it is correctly assigned. I changed the names before releasing it because in editor was confusing to use Trigger 2 like the first one. The assigned name in the meta data is the "correct one".

@Nahor
Copy link
Author

Nahor commented Mar 20, 2023

I suspect your comment about the "metadata" and "renaming" is related to the name of the cameras (the variable is named CameraX, while the DisplayName is "Camera Y"). If so, this is not what I'm talking about.

L57 and L58 both assign a BeginOverlap event listener to the component Trigger1. I would think one should be for Trigger1 and the other for Trigger2.

	Trigger1->OnComponentBeginOverlap.AddDynamic(this, &AFixedCameraTrigger::OnTriggerBeginOverlap1);
	Trigger1->OnComponentBeginOverlap.AddDynamic(this, &AFixedCameraTrigger::OnTriggerBeginOverlap2);

For that matter, the EndOverlap listeners are correctly set:

	Trigger1->OnComponentEndOverlap.AddDynamic(this, &AFixedCameraTrigger::OnTriggerEndOverlap1);
	Trigger2->OnComponentEndOverlap.AddDynamic(this, &AFixedCameraTrigger::OnTriggerEndOverlap2);

@gerlogu
Copy link
Owner

gerlogu commented Mar 20, 2023

Sorry, I misunderstood the issue. Thank you very much for notifying me about this! I have already released the fix 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants