Failed to Join the game

Hi,
I’m going to need more information. What exactly is happening when it fails to join?

What is in the log?
Is it crashing or doing nothing. Is there any error messages?

How are you running it - editor or command-line?
Which version of Unreal are you using?

Nothing is happening and I’m running the actual build for win64 and i use localhost [127.0.0.1]

That still doesn’t really give me any information. Try running via the editor from command-line with a log so you can see what is going on and share the log


This one

And to be clear, you are running 2 copies of the game? The first should be a host and the second should then join the game and this is the one that is failing?

yeah exactly!

Ok. So, there are a number of things you need to do.

  • If you are using UE5, make sure you turn off live coding, shut down the editor and delete the binaries folder.
  • Check all your code against the end of lecture.
  • Ensure your firewall permits connections - even locally this is required
  • You may need to specify the IP Address and port number of the server you are connecting to. The default port should be 7777.
  • Ensure VR Plugins are disabled.

The issue is most likely a code difference as the firewall is very unlikely. it could also be the server address is not correct.

It could be a single line of code that is not correct so make sure you go through it with a fine toothcomb to ensure you haven’t missed anything.

does 127.0.0.1 localhost work???

I tried erything but its still not connecting to server???

Localhost does work. Without the project I’m at an end as to how to help. What you could do is back up your project then replace the C++ code from the one in the course repository and see if that works.

I did change the code same as shown in the course but still no working???

The issue then would lie with the firewall on the pc.

I modified firewall and give access to public and private both network

github repo : https://github.com/vishal-ahirwar/Pzzzle

I’ll take a look but it’ll be next week probably

Ok, I cloned the project. I had a look at the code and it is so different that I can’t help you because the project it self, while it actually builds, does not run. All the assets are missing.

Maps, widgets, blueprints, meshes - all are needed to be able to debug the project.

Given that the code is so different - a file compare against the project lecture code reports so many differences that the issue lies within the code. However, I cannot solve this one for you. The job of a TA is not to fix your code but rather nudge you gently in the right direction.

My final suggestion is to strip your code back to the point you have a working solution and rebuild it a bit at a time. Also, I am not sure which version of the UE engine you’ve been using - when I opened it, the project required conversion to a version I had - and I have 4.25 onwards installed.

I’m sorry I can’t be of more help.

A couple of observations re the code

  • this-> is not needed for class variables. It just adds noise
  • Avoid single-line if statements. It makes the code harder to read

thanks finally I solved the issue :slight_smile:

Do you mind me asking what the issue was?

I am really glad you got it sorted.

Ohh yeah i just forgot to put “?listen”

	UWorld* World = GetWorld();
	World->ServerTravel("/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap?listen");

and btw i’m getting another error and I fixed it but i’m unable to figuring this out what’s the reason of the error???

void UMainMenu::SetMenuInterface(IMenuInterface* MenuInterface)
{
	this->MenuInterface = MenuInterface;
};

the error is
C4458 declaration of ‘MenuInterface’ hides class member

and when i replace SetMenuInterface() method’s parameter from MenuInterface to MenuInterface_(as this link said we must C4458

void UMainMenu::SetMenuInterface(IMenuInterface* MenuInterface_)
{
	this->MenuInterface = MenuInterface_;
};

and now it’s working fine

Privacy & Terms