UE4 Version 4.27.2
I am creating a project and I had a problem, it turns out that when an actor is available in the default world you can interact and pick up the object, but when you spawneas it through an object or in this case through the G it can no longer be picked up, I have recreated it in a clean project and the result is the same.
Object:
Simple blueprint (without code)
ThirdpersonCharacter:
-
Tick (This will run a line trace to identify the object you want to get.)
-
Client Handle Focus (This saves in a variable “current Actor” the actor you are looking at)
-
Get Usable actor (Line trace logic)
-
- Left:
- Left:
-
- Right:
- Right:
-
Variables:
-
Key E (Take):
-
Key E (Events):
-
Key G (Drop):
-
Key G (Events):
Finally what is the result?
It always works correctly when the object is already in the world on both client and server, both can pick up and drop the object.
Serverside:
Clientside:
The problem comes when the object is dropped and tries to catch again, the result in client is fast:
Simply in your camera does not disappear, due to the variable you can no longer drop again.
Simply in your camera does not disappear, due to the variable you can no longer drop again (It is evident that the client can not perform the collection of the object when before yes).
Apparently this is the result that one would expect from this action.
All the times that the server has dropped, it has duplicated the objects in the client and of course, every object that it takes, does not disappear.
EDIT: Occurs in both spawnActor From Class and Add child actor