x

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"

Spawn Actor multiplayer problem

Guys im trying to spawn a vehicle in my multiplayer game but whatever i do i have problem with clients . server can spawn the vehicle and get in the car and everything but whenever server spawn the vehicle or client spawn it i have problem . i tried get all actor of class vehicle and count the length by client and i realized that client actually knows when server or any client spawned a vehicle but there is no vehicle in client screen. i've tried multicast , run on server/client calling server and then multicast etc

Product Version: UE 4.21
Tags:
more ▼

asked Feb 10 '19 at 04:48 AM in Blueprint Scripting

avatar image

EZEL3050
10 2 1 6

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

2 answers: sort voted first

I fixed it finally and i felt really stupid :I , if you check my project again you'll see something , in 3ds max my unit was in millimeter so in unreal the vehicle was too big and i scaled it in 0.1 and it sort of messed the skeletal mesh i fixed the unit and return the scale to 1 and it worked just fine Thank you for your help

more ▼

answered Feb 12 '19 at 06:08 AM

avatar image

EZEL3050
10 2 1 6

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

You should call Spawn via Server call. Make sure it is set to Reliable. Then Server and all Clients should see it.

alt text

h-spawnrpc.png (147.7 kB)
more ▼

answered Feb 10 '19 at 05:03 AM

avatar image

Chyros
1.2k 8 4 8

avatar image EZEL3050 Feb 10 '19 at 05:37 AM

Yes that is exactly what I've done but look at this the left one is the server the right one is the client and in should spawn the vehicle by pressing enter but it happens on server and it also happened on client but its like the car collide with something and shoot away

alt text

avatar image Chyros Feb 10 '19 at 05:49 AM

Can you post your BP graph? You are probably using a location that is not replicated on server and client.

avatar image EZEL3050 Feb 10 '19 at 06:00 AM

I just created a simpler model in new project to show you so that its easily understandable and the problem still exist

alt text

avatar image Chyros Feb 10 '19 at 06:02 AM

You are missing a screenshot on how you use the SpawnActor?

avatar image EZEL3050 Feb 10 '19 at 06:04 AM

alt text

ezel-1.jpg (266.4 kB)
avatar image EZEL3050 Feb 10 '19 at 06:13 AM

https://youtu.be/FtCS4zSY-o4

this is the exact thing that happens its very short please watch it

avatar image Chyros Feb 10 '19 at 06:24 AM

As expected, your Spawn Location isn't replicated correctly. Instead of accessing that variable from the class, pass it to the Server event instead, see what I did below:

  1. Spawning 500cm in front of the Player alt text

  2. Server and Client without spawning yet alt text

  3. Server tries to spawn in front of him alt text

  4. Restart game and then Client tries to spawn in front of him alt text

As you can see above, wolf is spawned around 500 cm in front of whoever spawned it.

avatar image EZEL3050 Feb 10 '19 at 06:34 AM

I tried this one as well but look im sure the problem is with collision , i disabled the vehicle collision and it spawned it correctly for both , can you do me a favor please ? create a vehicle and wheels and all that stuff and try to spawn it i think there is something with vehicle collision because if i just change collision presets from vehicle to anything else the problem will be fixed but as long as its not vehicle the wheels don't work

avatar image EZEL3050 Feb 10 '19 at 06:35 AM

and BTW thanks a billion for your help and your time

avatar image Chyros Feb 10 '19 at 06:42 AM

Can you upload your project somewhere so I could take a look at?

avatar image EZEL3050 Feb 10 '19 at 07:00 AM

ok hang on please

avatar image Chyros Feb 10 '19 at 07:04 AM

sure

/10chars

avatar image EZEL3050 Feb 10 '19 at 08:15 AM
avatar image Chyros Feb 10 '19 at 08:49 AM

Got it. Will reply in few minutes.

avatar image EZEL3050 Feb 10 '19 at 08:51 AM

Thanks man

avatar image Chyros Feb 10 '19 at 10:00 AM

So I tried your project and experiences the same issues you have. Tried to tinker some things but to no avail.

And then I tried to make a VehicleAdvanced project and made a Spawn vehicle via Server and it works just fine. Here's the one I made: https://mega.nz/#!bGph3QKC!cgERwypH6oX5FdrZbJ7eY_aKrhL3RlAZ-BUV_4u1c04

I think there's an issue either on the importing or the Physics setup. Unfortunately I'm not expert on it so I can only suggest if you can somehow compare your project with VehicleAdvanced and see what causes the issue.

EDIT: Also, when I tried to change the Mesh of your vehicle from GC to ThirdPerson, it spawns just fine. So as you believe, its probably on the vehicle physics setup itself.

avatar image EZEL3050 Feb 10 '19 at 10:19 AM

Thanks it helped a lot i will compare the vehicle and also i'll try other vehicles and i'll let you know if i found out anything

avatar image EZEL3050 Feb 10 '19 at 10:33 AM

BTW is there any way for me to contact you if i had any other question in terms of multiplayer or optimization ?

avatar image Chyros Feb 10 '19 at 01:47 PM

You can always ask your questions here. Many people are very eager to help here. Also, I try to be active here as I can.

avatar image EZEL3050 Feb 10 '19 at 08:05 AM

sorry for taking long time i created a fresh project and kept everything as simple as possible i'm uploading the file its only 50 mb just check the ThirdPersonCharacter blueprint the vehicle will spawn by pressing Enter and make sure you are in a place that vehicle can be spawned

i'll send the link in a few minutes

(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