My item is not visible for others players in multiplayer mode

Hi,

I have a simple item let's say a cube that can be picked up by my first player. The item is placed on the ground when the scene starts. This is a runtime pickup object called RuntimeMyItemPickupUpThrowablePUN.

The player picks up this runtime item called "RuntimeMyItemThrowablePUN" (item of Pickup sets) that is a throwable item.

The player can throw this item where he wants with a trajectory. The Thrown object that I defined is "RuntimeMyItemThrowablePUN" and it is also the pickable item, in this way the player can pick up it, throws it and pickup again etc....

This scenario works fine for the player 1 but the player 2 cannot see the game object in the right hand. When he throws the item, the item is not visible for the second player or others players. Then the second or others players cannot interact with this item.

I cannot figure out what I am missing here. I am stucked on this quite standard case.

Basically, I tried to reproduce the PUN demo pickup grenadePUN but with a runtime object. I can see that is works fine in demo but doesn't see what I missed.

Any idea will be highly appreciated ?

Thank you
 
Last edited:
It sounds like an event isn't being sent. Are you able to repro it within the PUN demo scene? The bow and katana are runtime pickups.
 
I have reviewed the demo with bow and katana but I still don't succeed to have items displayed. When you said an event is probably not sent what do you mean ?
Could you put me in the right way ? Where should it be triggered ?
 
Hi Khan, thank you for your feedback.
Could you upload a screenshot of the event, and which one is it ?
I will have a look later today in bow runtime pickup, I probably didn't see it when I looked it last time
 
@LittleGrassHopper Yes the things you are going to pick up run time should be added to RunTime Pickups otherwise it won't show up to the clients. Also spawnable objects should be added to the Spawnable Class and everything will be good.
I have been working on this plugin from the past 1 year. And have been developing a cool multiplayer game.
The plugin is a bit complicated in the start but once you get to know things it is a good one.
 
Thanks for the explanations but I have already assigned Runtime Pickups and also Spawnable Objects from GamePun and this is the same issue.

I have reviewed again the bow example in demo scene glancing the Runtime Pickups and Spawnable Objects to be sure that the setup is identical.

But I found an issue with the layer assigned in Items where the component "Item Slot" takes place. I realized that the layer for First Person was Default instead of Overlay and Default instead of Subcharacter for Third Person Perspective. However, doing this change didn't fixed the issue!

But I saw the problem but I don't know how to fix it!

As you can see in the screenshots below, the item is enabled in First Person Perspective but disabled in Third Person Perspective whereas it should be enabled for both perspectives. When I manually enable the item in third person perspective as showed in the second screenshot you can see that the item becomes visible for all :D

But where I should act to have it properly enables when it should be?

Item in Item slot 1.png

Item in Item slot 2.png
 

Attachments

  • Item in Item slot 2.png
    Item in Item slot 2.png
    994.1 KB · Views: 1
Last edited:
Have you gotten it to work with non-runtime items? I would first try getting that working since that's one less thing that can go wrong.
 
I did a mistake. As I let the runtime pickup in GamePun it is always this bad setup that plays and not the simple item. Need to change that and I will post a new message.
 
I redo as you proposed but always the same result. I cannot figure out why the event is not triggered. I have the same setup than the grenade but instead I put a simple throwable object.
 
Thanks for the link but I saw this video several time and I follow step by step. I also reviewed all videos to be sure (regular and multiplayer with PUN, and FPS mesh tool).

My character is "punned" in the same way as you show in the video, I mean from the manager Add-On. I did the same for the items and "pun" them with the manager.

I did it with a grenade to mimic the demo and it is working in multiplayer mode but still the object is not enabled on all perpectives when players joins the same session. I have no error message.

Manually enabling the item in the Third Perspective displays the item as it should :unsure:

What is responsible to enable or disable the first and third perspective item? I might put a breakpoint to debug and see why it it is not done in my case.

I am sorry to boring you, I guess that is not easy to help with a such problem!
 
Last edited:
Are you able to repro it within a fresh PUN demo scene with just the included demo assets? If so this should give me a better idea of what is going wrong.
 
Maybe I was not clear. In fact PUN demo works well and I don't have issue with it. Items is visible between clients.

It is in my project that the problem comes. I have implemented the same thing, trying repro the grenade scenario but I don't have the same behavior and cannot figure out what I am doing wrong. I have had a look on the sources (ThrowableItem, Ultimate Chracter Location...) but not easy to understand all as I don't have full view of the code. It seems that somewhere we should call the function responsible to switch between perspectives and enabling or disabling the skinned mesh renderers. But with the multiplayer in between, it is a little complex to see what is wrong :cry:
 
Taking another approach, if you compare your item settings to the one from the demo scene can you get it to work? What if you add the demo runtime pickup, such as the katana, to your character - does that work? Basically try to narrow down what the cause is, and from there you can compare components.
 
Top