Results 1 to 14 of 14
  1. #1
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235

    Keybindings with fpv movement script

    Hello,

    I've build a fpv movement script and added keybindings to it.

    What can it do:
    - It lets you or the player set his own keybindings
    - I made it so that there is absolutely no sliding down on slopes (player friction is set to zero)
    - The character can climb allot of angles at different speeds depending on the angle.

    Default controls:
    - mouse to look around
    - A,S,W,D to move
    - SPACE to jump
    - SHIFT to run
    - K to open keybindings menu

    Download:
    With slope sliding (v0.9 if you need high substeps):
    keybindings movementscript2.blend
    (if you do not need high substeps and by default you don't need it, then i suggest to download the original version because the movement is much more realistic and have a heavier feel(climb the ladder with both files, i bet you like my original version)

    With anti slope sliding (v1.0 original):
    keybindings movementscript.blend
    (if you need high substeps, take link above OR adjust the script to look for a property as well, then place a plane on the slope put the property on it, and problem should be solved)


    I hope you all like it,
    Cotax
    Last edited by Cotaks; 30-Mar-17 at 19:34.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  2. #2
    Thanks. I realy like it.



  3. #3

    Movement jump Problem + substep problem

    Hello Cotax. I am using some of your scripts in my game and I realy like them. But i got some problems.


    Its about the movement script:


    1. When I adjust the substeps in my game from 1 to 3 or more, the player begins to go up and down very fast. Its someting like a bug.


    2. When I am close to object for exempel a wall and try to jump while the "W" "forward motion" key is presset i cant jump.


    Do you know how I can fix this problems?


    Blend File- https://drive.google.com/file/d/0B9_...ew?usp=sharing


    Thanks for the help.



  4. #4
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    1. no idea, i have set all physics from 1 to 5 substeps etc all works like it should be. (no chaking)

    2.the first (big) player does how it should be, the other has the material disabled (how did you duplicate it? never seen it this way)
    select the player box head to material, look at the name of the material, there is a little paper icon with a small arrow pointing to the right side (direct linked data block, make it local), click on it, now put friction on zero and at physics tab -> collision bounds hit compound.

    no idea what you have done to be honest, you got a lot of errors in the console.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  5. #5
    Hello Cotax. Thanks for your replay. I imported the files in the hard way because I am a bit noob. I append some of the obejcts from your file and then copy and paste them and delete the appendet files with the blue surrounded lined "Not 100% sure how i did it" . I am also a bit confused.

    But about the BUG. I have looked in to your original file and there was that BUG too. I think its because the sensor object for the ground. But when I set the substeps more than 1 the player bagans to go up and down. I have also gif. -- http://goo.gl/AD6DSv . I am not sure if you can see wath I mean. Its someting like bobbing UP and Down realy fast.

    Thanks for your help and your scripts.

    Sory if I disrupt / irritates you.
    Last edited by Asdfghjkl; 19-Mar-17 at 18:45.



  6. #6
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    i found the error and indeed high substep with the sensor cube will make the player shake, strange but normally you dont need to increase the substeps, you can leave it as is.

    to fix the problem if you need high substep, select the ground sensor cube, remove the groundcheck sensor
    place the ground check sensor (with the exact same name) to the player cube and connect it with the movement script.

    it will not bounce anymore, but movement behavior will change a bit.


    Sory if I disrupt / irritates you.
    not at all, if i can't support my own 'products' then i should not have it posted here but to be really honest i attached that movement script to the keybindings as an example of how to do it and to show that it works (i dont even use that version my self, that's why that version is not included in my sig).

    I also checked all my other FPV and TPV setups (i always use a cube as sensor) and they don't have the problem, i think this is a combo of an old blend in a new blender version, that script was made in 2.60 i believe.
    Last edited by Cotaks; 20-Mar-17 at 12:17.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  7. #7
    BA Crew Fweeb's Avatar
    Join Date
    Sep 2003
    Location
    Atlanta, GA, USA
    Posts
    10,035
    Moderation: Moved posts to this thread where they make a bit more sense. In the future, I'd rather not do this. Please just link to the other thread rather than request splits and moves.



  8. #8
    Thanks for the help!



  9. #9
    Sorry. I did not know.



  10. #10
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    Ok i did some more test related to the bouncing problem.

    I do now know the official ''bug' it has nothing to do with the cube sensor, The problem is the way i build the anti slope sliding.
    While the workaround i posted works, this is not the best thing to do, i will update a new blend and going to remove the anti slope sliding from it, so that you got a working example/blend with high sub steps.

    @fweeb
    Thanks for the time spent moving the post.


    #edit
    added v0.9 removed the texture to reduce file size, and removed the anti slope sliding.
    I dont like it(at all), but if you really need high substeps there is a version for it now.
    Last edited by Cotaks; 22-Mar-17 at 10:52.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  11. #11
    Hello Cotax. Thanks for your replay and the spend time. I like the v0.9.


    1. The jump problem near wall is fixed, so when I am close to wall and try to jump the player wil jump correctly.


    2. When I have more substeps than 1 the player wil not Bounce.


    But know I found another small problem. When I try to go up a hill or something that is sloped "fx. the orange object in your file", the player goes too fast up. I made the angle of the slope smaller but the player was still able to climb.


    I tried to edit the script and I deleted the "z = own.worldLinearVelocity.z" and replace it with "z = 0.0" and that worked for the slope in some cases, but know the player can't jump.

    Is there any easy way to fix it?

    Thanks.
    Last edited by Asdfghjkl; 22-Mar-17 at 12:37.



  12. #12
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    haha i knew that would come. thats why i said that i dont like that version
    follow the thread in general discussion, ive asked there if there is a good way to stop the sliding.

    but you can also let the collision check find a property on a plane and then put the no sliding on.
    then you would only see it bouncing when standing on a slope if there is bouncing at all and you get the general feeling back.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  13. #13
    Thank you very much. It has been long discussion here and I wanted to thank you for your spend time.



  14. #14
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    Thank you very much. It has been long discussion here and I wanted to thank you for your spend time.
    no problem.

    I tried to edit the script and I deleted the "z = own.worldLinearVelocity.z" and replace it with "z = 0.0" and that worked for the slope in some cases, but know the player can't jump.

    Is there any easy way to fix it?
    Hehe needed to say you are asking for it, the fix is the option that i have removed in v0.9 :P so grab v1.0. but then you bounce again with high substeps. Solution fake slopes with a plane as detection, so when you hit the plane the anti slope sliding kicks in else it stays off.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •