Need help making an online game

Hi @WilliamBoersma31, that’s too little information to help you out.

The only thing that comes in my mind is check using the console or the debugger if data is properly defined / has correct values before using it in the teleport method.

1 Like

Hi @Leonidas I fixed the error but it still does nothing.

If you wanna take a quick glance at my code it’s linked HERE

I’ve launched your project and got the following error:

Check the following thread on how to resolve that on glitch:

1 Like

Hey @Leonidas how do you whitelist a link?

What do you mean you just have to copy the website or comments like here
An example: This is weird i need help

I’m refering to this post

Dec '20

Hi @Karl47,

You need to whitelist the playcanv.as domain name on your glitch.me project, or use a cors extension on your browser while developing as @agent178 said.

@Leonidas @Gabriel_Dobrzynski the weird thing is I didn’t have to do that with the other game.

Weird, Im not sure.

@Gabriel_Dobrzynski What do you mean?

that is the weird thing

@Gabriel_Dobrzynski Yes because it’s weird because it’s the same code for this one i have to do a whole bunch of extra stuff but with the original it just worked

1 Like

@leonidas nothing is working and I can’t seem to get that same error I really need help

HERE is the glitch code
and
HERE is the playcanvas code

Hi @WilliamBoersma31,

Take a look at the multiplayer example project, @yaustar recently updated the code and it works quite ok:

https://playcanvas.com/project/406048/overview/tutorial-realtime-multiplayer

2 Likes

Finally, It works :smiley:

@Leonidas it didn’t work for me but I don’t understand why the original code works HERE but not HERE

The server code is different between the two

Your original is using socket.io v2 https://glitch.com/edit/#!/bg-william-co-2?path=package.json%3A15%3A4

image

Your new project is using socket.io v3


image

And therefore needs CORS to be setup properly on Glitch as shown in the Multiplayer tutorial
https://developer.playcanvas.com/en/tutorials/real-time-multiplayer/

Which was mentioned in an earlier reply here: This is weird i need help

1 Like

@yaustar I fixed it and it still didn’t work.

As you have installed the v3 package already, it won’t revert to a v2 package as it’s older. Get rid of the ^ to force it to install v2.

@yaustar when I loaded up the scene I had the what the other what the other player is supposed to be on my waist.