Need help making an online game

@Leonidas I used the code you gave in the example and it told me
getEularAngles is undefined

Try then debugging your this.PCOLLSION property, since it’s undefined. If you can provide the full code of that method I may be able to know more.

So before anything else, it’s getEulerAngles() not getEularAngles().

ok Thanks

Make sure to give the docs a look when you get errors, that’s where you can find the correct names for the engine API.

https://developer.playcanvas.com/en/api/pc.Entity.html

ok thank you

@Leonidas now the sending part works but when it tries to rotate the other player it doesn’t work

Check using the browser console if the angle is correctly received, it’s the number that you are sending.

how do I access the browser console?

That’s something you will have to learn eventually, it’s not specifically for PlayCanvas only but a skill you should have when doing web dev.

Try searching online for “how to debug using the browser” and you will plenty of materials. It may take a while but be patient and learn how to do that. It will help you resolve many of the problems you had in this thread.

@Leonidas thank you also do you know how to make button cool down?

Which button are you referring to?

like fo jumping so if you press space then it will apply a force and start a cool down where you cant press it again

So the simplest way to do this is using a timeout, much like the first person movement engine example does it:

https://playcanvas.github.io/#camera/first-person.html

If you jump up, you are allowed to jump again only after 0.5 sec has passed. Here is the relevant piece of code:

I need code to have the player’s marker’s rotation match the rotation of the player themself.
@Leonidas You have been helpful in the past. (the code you gave me last time didn’t work it just made the character disappear)

Hello @WilliamBoersma31
If you are willing to do that, I suggest to make a thread about it! :smiley:

I merged the thread as they asked about player rotation earlier in this thread.

1 Like

I recommend learning how to debug in the browser. It’s an incredible useful skill to help solve issues that you run into https://developer.playcanvas.com/en/user-manual/scripting/debugging/

1 Like