Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Owner No See/Only See for actors spawned by server

I have used the Owner No See/Only Owner See functions successfully while setting up my First Person mesh and Third Person mesh in my character for my networked game. The 1PP Mesh is set to Owner Only See and the 3PP Mesh is set to Owner No See and everything behaves as expected.

However, I am having trouble getting it to work correctly in another situation:

I have Weapon_Base blueprint that all my weapons derive from. In this BP I have the 1PP Mesh and the 3PP Mesh, like so:

alt text

The 1PP Mesh component is set to Only Owner See. The 3PP is set to Owner No See.

When a client equips a weapon, the server spawns the appropriate weapon BP and sets it as the CurrentWeapon variable, which is RepNotify. In the OnRep, the clients then attach the 1PP and 3PP mesh components from the Weapon BP to the appropriate socket on their skeletons.

The result is below. Clients see only their 3PP weapons (which are Owner No See), and they do not see their 1PP Weapon (Only Owner See).

alt text

I imagine this is because the weapons are spawned by the server, but to my knowledge that is the only way to keep things replicated.

Is there a different way to emulate Owner No See/Only See for things that are spawned by the server but should be owned by a client?

I have a workaround that is basically to store the 3PP and 1PP meshes as variables instead of components, and the clients use that variable to set a mesh on weapon slots that are already on the character. This workaround functions correctly, but it has the downside of not being able to fully use the Weapon BP, like attaching things directly to the weapon in its components, etc.


Product Version: Not Selected
1.png (9.1 kB)
2.png (2.1 MB)
more ▼

asked Mar 07 '15 at 07:59 PM in Blueprint Scripting

avatar image

1.2k 63 33 96

avatar image zuert May 02 '15 at 01:15 PM

I have the same problem. I have exactly your set up, I attach my 3p and 1p weapon in a OnRep function.

Are you be able to fix this problem?

avatar image JaroMast Mar 18 '17 at 04:38 PM

In 4.15 you are able to set owner, but still, Owner No See/Only See doesn't work on client side

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

The problem here is, that you can't set the Owner in Blueprints right now.

The owner of every actor can be set with "SetOwner(AActor* NewOwner)" in C++. This is used for network replication so i guess it would solve your problem.

I'm currently not quite sure if the Client Version of your weapon also has the server as it's owner. Because you can change the visibility of a weapon mesh on the client and on the server differently (by just calling SetVisibility either on the server or on the client with a replicated custom event).

You could try to use this: After spawning the variable, let the Server do a multicast (custom event) to set the visibilty to false. After that, you make a normal client custom function (replicated to client) and set the visibility to true.

This should hide the mesh for all other players (and the server) but the one who has it spawned.

You need to remembr that this weapon exists multiple times. It exist on the Server Version of your Character, on the Client Version of your character and on all the copies of your character that the other clients see.

Multicast will call function on ALL versions. Client will call them on your client character. Server will call on function on the server version. With that you should be able to change the visibility like i said above.

So you don't need to use the bools (ownernosee etc). I hope this helps.

If you have more question, feel free to ask me (:

more ▼

answered May 02 '15 at 03:08 PM

avatar image

6.8k 333 185 470

avatar image zuert May 02 '15 at 04:38 PM

Its a nice idea! I try it, the multicast event works well but not the other. Maybe its my set up.

alt text

alt text

avatar image eXi May 02 '15 at 05:08 PM

Change the ClientDisplayWeapon from "Running on Server" to "Running on Client"

avatar image zuert May 02 '15 at 05:19 PM

oops, wrong screen sorry. "Run on owning client" display the weapon for all players.

avatar image eXi May 02 '15 at 05:22 PM

Could be because you call this in the OnRep function. I would calls this in the BeginPlay and make sure that only the server calls it with "Switch has authority" node.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I ended up using the workaround I mentioned.

more ▼

answered May 02 '15 at 01:37 PM

avatar image

1.2k 63 33 96

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question