Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
FPS Mouse Look behavior with sensitivity support

smnmhmdy
Registered User
Quote
2021-03-01 17:57:25

This behavior will handle the fps camera rotations, which allows the mouse sensitivity to be changed at run time.
Put Mouse Look above the built-in fps behavior with it's rotate speed set to 0.
🔎︎

Sensitivity can be changed at run time using Setting_Sens (or Setting_SensH and Setting_SensV if you want different sensitivity values on horizontal and vertical movements) js variable.
Sensitivity can also be changed using the mouse wheel in real-time.

Download:
https://www.dropbox.com/s/o07uod...


just_in_case
Moderator
Quote
2021-03-01 20:37:18

Works great rotation is smooth as butter thanks a lot for sharing😇


marcw
Registered User
Quote
2021-03-02 11:39:25

Smn Mhmdy, thank you for this great mouse behavior.

Additional features like this one or like a perfect TPP camera controller offer the possibility to create games where the user-friendly experience for the player is taken into consideration by the developers.

The content of the file "behavior_MouseLook.js" shows an unexpected level of complexity requiring serious programming skills and a deep knowledge of javascript.

The included lines of codes "Matrix transformation handler" for which you give credit to Nikolaus Gebhardt demonstrate the hard work he dedicated to the creation of CopperCube.

:-)


smnmhmdy
Registered User
Quote
2021-03-03 12:53:41

@just_in_case @marcw I hope you'll find it useful :)


Robo
Guest
Quote
2021-08-06 14:16:51

Great addition and very much needed.

If I wasnt using my animation controlled camera I would use yours as its quite good - cheers!


sixvivid
Registered User
Quote
2024-01-20 07:20:24

I have tried and tried to interact with these variables with my own script and nothings working. Please help :(


just_in_case
Moderator
Quote
2024-01-20 07:38:42

Without looking at how you are using these variables in your script, it's abit harder to tell you why they are not working. Either provide the code or explain how you are using the variables in your script.


sixvivid
Registered User
Quote
2024-01-20 07:42:27

Of course, I am trying to display the value onto a 2d overlay and have buttons to increase and decrease the sensitivity



Label (runs every ms):

var thisSens = ccbGetCopperCubeVariable("Setting_Sens");
thisSens = thisSens.toString();

label = ccbGetSceneNodeFromName("sens");

ccbSetSceneNodeProperty(label, "Text" thisSens);



Buttons:

Settings_Sens = Settings_Sens + 1

and

Settings_Sens = Settings_Sens - 1


sixvivid
Registered User
Quote
2024-01-20 07:45:25

Also thank you for the fast response :0


sixvivid
Registered User
Quote
2024-01-20 07:49:47

Another addition, yes the comma is missing there, it isnt missing in the actual code


sixvivid
Registered User
Quote
2024-01-20 07:50:58

Settings_Sens is not defined is returned in debug


sixvivid
Registered User
Quote
2024-01-20 08:03:11

Any idea why I cant access Settings_Sens expect with mouse wheel....


sixvivid
Registered User
Quote
2024-01-20 08:03:36

I can't seem to access the variables you mentioned...

smnmhmdy wrote:
This behavior will handle the fps camera rotations, which allows the mouse sensitivity to be changed at run time.
Put Mouse Look above the built-in fps behavior with it's rotate speed set to 0.
🔎︎

Sensitivity can be changed at run time using Setting_Sens (or Setting_SensH and Setting_SensV if you want different sensitivity values on horizontal and vertical movements) js variable.
Sensitivity can also be changed using the mouse wheel in real-time.

Download:
https://www.dropbox.com/s/o07uod...



sixvivid
Registered User
Quote
2024-01-20 08:09:26

Through trial and error I think I am figuring it out, but if anybody knows more about this behavior I'd love to know as it works good and im having ease of use issues with it so more expanation on original post would be nice albeit great work keep it up and thank you for the behavior


sixvivid
Registered User
Quote
2024-01-20 08:27:31

How would I go about changing this variable in a different scene... that seems to cause an issue


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

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


   






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