How to make two actors communicate

Hello! I want to know whats the best way to have one actor communicate with another? I’ve started working with UE4 very recently and I’m still very new to it.
What I want to make is a tree actor that, once it is interacted with by the player, it would communicate with a coconut actor and enable its physics. Basically, when the player interacts with the tree by pressing a button, the coconuts will fall down.
I’ve already implemented an interaction system thanks to a tutorial that I have found on Youtube, but I’ve failed to decipher the method to have the tree actor tell the coconut actors to enable their physics once the player has interacted with the tree.
I’m very new to UE4 and I would really like to get some help and guidance of any kind! Would be much appreciated! Thank You.

The blue wire/pins are object references and by plugin them to target input you calling function node on them. You actor is no different. So you need a reference and there countless methods to get one depending what object you trying to access.

You spawning the cocco nut right? Then Spawn Actor node outputs referenced to spawned actor, it gives None if actor failed to spawn. From that pin you can make calls on spawned actor. If you want to continue interacting with actor in that blueprint you need to make object variable of type of you actor (note that blueprint is a object class same as C++ class) and set it with output of Spawn Actor so oyu can keep it for later

If Cooconut is pre-placed on level, you need to make varable in tree and make it “Instance Editable”, if oyu have multiple of them then create array. Now you can see varbale in property editor when you click the tree and you can set that variable for that instance of actor and your code can make calls to it.

Note that some nodes return objects in different type then class you getting (most common class they can have), for example Get Game Mode will return GameMode, but since you know that GameMode is your class you can cast it to it and do calls on your blueprint

I made video way back explaining objects and classes in UE4, it might help you understand things more

Thank you very much for answering! But can you be a little bit more specific? I tried to create a boolean variable in the coconut actor and then create a function in the tree that casts to the coconut and sets the boolean to true. But not only it doesn’t work, I get an error warning sign after running the game and exiting from it.

Is there a way you can give an example ? I’m not fluent enough with UE4 to know exactly what I’m missing or what I’m doing wrong. Thanks for taking your time to answer tho!

edit: I was able to set up an event dispatcher in the tree and bind it via the blueprint level to the coconut through a custom event that then simulates the physics (don’t know if this is the best option to solve this issue) but then I ran into the problem that I can set the physics of only the mesh component of the coconut actor rather than the whole actor. My actor has an empty icon as the root and then 3 components (which are static mesh, sphere collision and a UI).

Certain things cannot ‘simulate physics’. You would need a root component that is capable of stimulating physics like a collision sphere and then everything beneath it will also simulate physics. As for communicating between actors, yes, casting should work fine assuming you get the proper reference object type. Interfaces, event dispatchers and straight casting could get you what you want. If you need help implementing this check out video #1, 25 and 26 in the link below. They are most relevant to what you are trying to do.

I don’t know how to change my actors so that they will simulate physics. If I set the mesh as the root then it screws up everything regarding the actor (such as position and the ability to resize it). I followed this guy’s tutorial (Let's Make: An Interaction System: Part 1 - YouTube) on creating both an interaction system and a parent blueprint. His interaction system is exactly what I need but I ended up running into two problems: Interaction still occurs through other actors and, since the root component is an icon, I can’t seem to toggle physics on for the whole actor.

Make the root a collision component. Those can simulate physics and you can toggle it on and off for the component which if everything is parented to that component it will toggle for the rest of the actor.

Thank you very much for your help! Your advice worked!
I only have one issue left and that’s that I can still interact with objects through walls and other non-interactable actors. This is because I’m basing the interaction on an overlap trigger sphere as well as a vector dot product that basically checks which item is closest to the player’s camera forward vector (this is done so that if two interactable objects have their trigger spheres overlap one another, both objects won’t give the option to be interacted with at the same time).
What do I add that prevents the player from interacting through ‘solid actors’ ? Is there an option I an enable? or do I have to use tracing ?

Probably a simple line trace will do the trick. If it hits the correct object continue if not fail out.