Quantcast
Channel: Questions in topic: "swimming"
Viewing all articles
Browse latest Browse all 107

Changing FPSController values via C#?

$
0
0
Hello, I'm trying to change some FPSController values under certain conditions. Primarily when underwater, I have a detection script setup which changes fog colour and such when under a certain y position but want to know how I can reference other Javascript elements from C#. I have my underwater.cs script attached to my main camera. Here are the things I want to effect: - CharacterMotor.js gravity = 0 - Need some buoyancy, what could I change to simulate this? Gravity = -1 makes you rise but the movement keys make that more apparent. Not really sure what to do? - How can I change the character controller so I can move in all directions rather than just left and right? Just to put this into perspective: void SetUnderwater () { RenderSettings.fogColor = underwaterColor; RenderSettings.fogDensity = 0.01f; //CharacterMotor.gravity = 0; //Buoyancy //Movement directions } Thanks for your time!

Viewing all articles
Browse latest Browse all 107

Trending Articles