Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Please niko change programming of water surface, set that the player can swim in it. |
||||
|
Hey, it is possible already, but not as easy as checking a checkbox. Basicly it functions like this: ------------------------------------ You need to use variables that you define yourself, (I put these in the scene-name-node - on top in your scenegraph explorer window).: When the game starts: earth=1, water=0 (swim=0) Set a behaviour on the waternode that checks if the player is in proximity of the waternode. If so, then change the variable "water" to 1 and "earth" to 0. You also need to set up a behaviour "every few seconds to something", for example in the same scene-name-node. So, after x ms, if checks if water=1, and if it does, it changes the active animation (to swimming/floating) for the player if the variable "water"=1. Also, of course you'll need to do the reverse - if the player leaves the water for ground - variables has to be changed in order for animation to change back to standing/walking. -------------------------- This is the basic explanation which changes the player animation from walking to floating. There has to be more variables to set up if you need to also MOVE the player in the water by swimming. For example: Define a swim-variable in the same scene-name-node as well, with a value of zero. Set up a "checking system" by a "every few seconds do something-behaviour. So if water=0 AND variable for keypress (for swimming (lets say "up-arrow") is 1, then change swim-variable to 1 AND change animation to swim. BUT, there is another thing - read on: Although my first attempts in doing this failed and I could not understand why - it did look rock-solid and still it did not change animations. Quite recently I actually understood why: My solution was to NOT use the "Game behaviour/person controlled by keybord" for my player, as it probably interfered with the change of animations when doing this. Especially when you want to MOVE your player in the water = swimming. (the general movement-behaviour seems to sometimes overide other animations, even if you choose another key press for swimming/climbing than the already used keys (up, down, left, right and space). So, if NOT using the "player controlled by keyboard", another script for movement has to be used. Which I found in the forum. If you go for my prescription - search for it! Otherwise I can copy/paste it here again later on. If you use that movement-script instead, then you have to check the variable for "key-press-up" in the script with a "every-few-seconds-behavaiour). In short, this could look like: if variable "movement_forward"=1, and variable "water=1", and var "earth=0", then var "swim=1" and animation for player=swimanimation.x. etc... Try tweaking around with this for a while to see if you figure it out. Eventually I might do a video-tutorial on this one, as it involves quite many variables that needs to be checked if they are on/off, etc, in order to execute correct funtions. |
||||
|
Yes, but I need that when we hit or come near to water remove gravity for camera. In simple words: How to remove gravity manually for a specific scenenode
|
||||
|
like behroz-khan I too would like the ability to toggle gravity on and off during run time. is it possible?? nobody knows... |
||||
|
Currently not possible, no sorry :/ |
||||
|
It is actualy quite straight forward with javascript.. Simply get the position of scene node and move it in the direction of up on loop...you will have to play around a bit with how many voxels u move the y axes.... but give it a bash |
||||
|
You can turn off the Gravity during runtime.... but turning of gravity means... turning it off for the whole scene... it will affect the whole scene... Currently there is no such feature/option available to toggle gravity on or off for a specific scenenode as @Niko Already stated in the post above... But if you want to turn it off for the whole scene then yes it is possible and is easy as checking a checkbox... |
||||
|
it is possible??? but i didn't read anything about this in the manual... |
||||
|
Here is the code to deactivate gravity. var root = ccbGetRootSceneNode(); |
||||
|
As i already told you... It is easy as checking a checkbox... @pmax wrote exactly the same thing..... But the thing is that it will turn of gravity for the whole scene... A buoyancy feature is still required to make things float on water.... |
||||
|
WHAT?!?!! YEAAHHH!!!! Thanks guys! |
||||
|
Anyone up to making an action or behavior for MTM? I would be interested in buying that...depending on what it end up doing... you can be quite creative with this |
||||
|
There are very few peoples who wants to sell the rights, because if they wanted to sell the behaviour/action they created , then there will be more earning if they sell them by their own... Paying 15% commision sounds okay than selling the rights...... |
|