Dynamic Multicast Delegate not Broadcasting! Help!

Please view my answer to this question for the actual question

First thing, you are using for your line trace “LineTraceSingleByObjectType” and “ECollisionChannel::ECC_GameTraceChannel1”, so did you actually create a new Object channel for this new Object type? The reason it not working is because you are using this different collision channel for your Rotate() function than your Grab() function.

To create the new object channel go to ProjectSettings->Collision->ObjectChannels and create your new channel. Set Defaults to “Block”. (note that it has to be an Object Channel and NOT a TraceChannel as you are using a “LineTraceSingleByObjectType” trace).

Then you must go to your Project Folder then Config->DefaultEngine and open that file. There should be a line that says something like:

+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,Name="NameOfYourChannel",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False)

make sure you are using the correct ECC_GameTraceChannel for your Rotate() function.

Then in the objects that you want to “Rotate”, you must go into their Details Panel->Collision. Set “Collision Presets” to “Custom” and “Object Type” to “NameOfYourChannel”.

Then the second thing, why do you want to use an Event Dispatcher (Delegate) inside the Tick Event. Event Dispatchers (Delegates) are for things you only want to occur when something changes, putting this in the tick event voids that purpose.

You can simply do this and it will broadcast when you can “rotate”:

void UGrabber::Rotate()
{
	auto HitResult = GetFirstPhysicsBodyInReach(ECollisionChannel::ECC_GameTraceChannel1);
	auto ComponentToGrab = HitResult.GetComponent(); // gets the mesh in our case
	auto ActorHit = HitResult.GetActor();

	/// If we hit something then attach a physics handle
	if (ActorHit)
	{
		UE_LOG(LogTemp, Error, TEXT("Actor Hit"))
			
		TurnStatue1.Broadcast();
	}
	else
	{
		
		UE_LOG(LogTemp, Warning, TEXT("Actor Not Hit"))
	}

}

I don’t think it’s the line tracing that’s the problem because if I replace the broadcasting with a UE_LOG output then it does output. So the line tracing works fine. The Grab and Rotate are different, the grab is meant to pick up objects with object type physics body, I didn’t want to pick up the statue so I made a function called Rotate which line traces for GameTraceChannel1 so it can broadcast the rotation event to that statue. Even though I have proved the line trace works fine and detects the statue it still doesn’t broadcast. And I put the broadcast in the tick event instead of the rotate function because it usually crashes when I put it in the rotate function when the function is called. Oh and I posted an answer because I don’t know how to directly reply to your answer.

I haven’t tried it yet though. I will try it soon and tell you if it works

It hasn’t worked. Nothing happens when pressing E,