ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Weird Camera Controls in WebGL
person icon
fnafrad
Registered User
Quote
2024-08-04 01:11:34

Hello
So I have been Making games in Coppercube for about 8 months, but every time I make a game for WebGL in the First Person Camera I have to Click the Page to enter the Camera, and when I Publish my game sometimes the Camera will not move when I press WASD or the Arrow keys, and I want to know if can or can't fix it
Thanks

person icon
Guest
Guest
Quote
2024-08-04 02:03:35

I am not a WebGL dev, but I believe someone corrected this problem in the past. I think it was needed to play the games on Itch or something. I don't know... This says it's Itch specific... https://vazahat.itch.io/itchio-k...

Take a look at that. It's possible you are also using functionality from the JS API that isn't supported in WebGL. Some of that stuff doesn't work on certain platforms. Wish I could be of more help, but I simply have not used CC for WebGL.

person icon
fnafrad
Registered User
Quote
2024-08-04 07:34:38

Thanks for The Help!

I tried it and it did fix the Player not moving on start but the click problem is still there, but the not moving one was the mayor problem for me

Thanks

person icon
just_in_case
Moderator
Quote
2024-08-04 12:02:56

Are you using the webGL game in a third-party i-frame wrapper, just like itch.io, or using the default coppercube-generated webGL game?

Also, is the option to "Look only when mouse down" checked in your FPS camera behavior?

There is a pointer lock option for the FPS camera option in the publishing settings make sure you enable that option.

It is better to create a start screen with a button, that says start game as the pointer lock will not be enabled by default due to browser security features unless the user interacts with it.

So the workaround is to use a "Play", or "Start" button at the beginning of your scene, you can try using a different camera for that instance, and then the user can click the button which will switch to the FPS camera and it will also most likely lock the pointer for the camera so that the game will run normally then.

You can also try simulating a fake user interaction but I am not sure if it will work or not.

hope that helps! :)

person icon
fnafrad
Registered User
Quote
2024-08-14 22:44:21

Thanks for The Help!

Thanks but while reading this I also made a more simple version of your idea,

First Make a First Person Camera,

In the Behavior of the Camera you will see First Person Style button,

Click it and Set the Move Speed, Jump Speed and Rotate Speed to "0"

Next Remove the Collide when Moved Behavior,

Now Make a Cube
It could be any Mesh but I do Recommend the Cube for a Menu

If you want Customize with Textures your Mesh,
for Menu's I recommend Making a Start or Play image to put in the Cube
Rotate the Cube if the image is upside down and Scale it if your Texture is too small or weird,

Next Put the Cube where The Camera's Target is Seeing,

Now in the Cube's Behaviors Put the "When this is Click" Block,
In Action Put "Change Active Camera" and put The First Person Camera you want.

also Check if "Use Pointer lock" is checked

Now Test the game in WebGL
Click on the cube
And it Should Work

Thanks to just_in_case and "Guest" :)

I Hope This Helps :)


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |