Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Snowboard Game Starter (Template)

Discussion in 'Assets and Asset Store' started by FreebordMAD, Dec 4, 2015.

  1. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    Thanks for the reply.
    Yea I worked you mobile controls, I didn't fully understand how the buttons were displaying at first, but after some tinkering around worked out they scale for all size devices.
    I was stupidly resizing the screen sizes during runtime, which doesn't scale them properly.
    But all good now. thanks again.
    Oh awesome package too...
     
    FreebordMAD likes this.
  2. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Glad to hear! Revert if you have any more questions.

    It would be super cool to see that in an asset store review ;)
     
  3. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    will defiantly add a review.. its a solid package.
     
  4. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    OK review done on the asset store!!
    More stupid question time, sorry.
    I can't seem to find where I can alter the positions of where the Jump and the grab button are at.
    There just a little to close to the edges for my liking. the joystick and other buttons are fine.
    I just would like the jump/grab button to be of the edges a bit more.
    Thanks!!
     
  5. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Thanks for the review, I'm sure it will help a lot! As you surely know, there are no stupid questions only stupid answers.

    In the file PlayerInputDevice you will find the PlayerInputSimpleDrawWithStdBtns class. It mainly consists only of the constructor, which sets the position of the buttons on the screen. Let me know if that info is enough.
     
  6. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    ok, I don't really get it.. haha I don't understand where in that code to change it to raise the buttons a little bit higher.
    Sorry, my brain isn't that great!!
     
  7. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    upload_2021-5-22_20-18-37.png
    Try the code below it will move the buttons a little up (5% of the screen height).

    Code (CSharp):
    1. m_jumpBtnRect.y -= Screen.height * 0.05f;
    2. m_grabBtnRect.y -= Screen.height * 0.05f;
     
  8. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39

    Perfect!!!!!!
    Thank You Very much!! Appreciate it...
     
    FreebordMAD likes this.
  9. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,841
    Very awesome asset, very easy to get into with flexible customization and very quick results. I'm more into free ride and HDRP though :)

     
    lukasynthetic and FreebordMAD like this.
  10. 76bigfoot

    76bigfoot

    Joined:
    Oct 14, 2015
    Posts:
    7
    Sorry, total noob question. I downloaded the Snowboard Starter Kit, and created a build. The build is set to PC, Mac, and Linux Standalone, and the build does complete successfully. However, the build fails to run. I did start with a URP project when importing the starter kit. I didn't change anything further. Is there something I need to modify to make the build run? I'm using Unity 2020.3.11f1. I've built several other games without this asset, and haven't run into this so I don't believe its my machine.
    SnowboardFailedBuild.png
     
  11. 76bigfoot

    76bigfoot

    Joined:
    Oct 14, 2015
    Posts:
    7
    Update: I tried it without URP, and received the same results. Thanks in advance for any help.
     
  12. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Can you please fetch the Unity log from the build and post it here?
     
  13. 76bigfoot

    76bigfoot

    Joined:
    Oct 14, 2015
    Posts:
    7
    Update: Thanks FreebordMAD. I found that it was my desktop PC. Building it on my newer laptop, it works! If you are cool with it. I'll delete these posts. No reason to junk up your forum with my personal desktop issue. I may investigate why my desktop doesn't work as it does play modern steam games without issue, but that will be later. Thanks again for responding.
     
  14. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    You don't need to delete your posts, but you can if you want. Would be cool if you can post here once you know what caused the issue - it might be unrelated to my tools, but others might have the same issue.
     
  15. emmyjemmyjammy

    emmyjemmyjammy

    Joined:
    Jun 23, 2020
    Posts:
    2
    I was wondering how you might recommend going about adding a "wind-up" feature, like how in SSX tricky if you held the jump button and a direction on the d-pad prior to a jump it would give you more spin/flip momentum. Mostly for a gamepad because the mechanic would be awkward to achieve with keyboard and mouse. I see that after the setIsAir variable is declared there's a part called PlayerState.TakeOff and under handleStates, would I add code there or would I also have to change a lot of the vector3s and constants? I apologize that I'm not the most skilled with coding so vector3's are still really new for me though I understand the concepts.
     
  16. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I don't think you need to do any 3d math (vector) stuff to achieve what you want. Check the PlayerInputHandler class. In the Update method you have the same statuses handled as you found in the controller class, but a level higher. Here you could save some variables while the player is in PlayerState.Ground state, e.g. how much 'rotation boost' did the player load up. Once the player controller switches to the PlayerState.Air you could use these variables. For example, you could multiply the rotFactorY variable in the handleAirRot method. Just multiply it by the 'rotation boost' that was loaded by the player before calling applyRotationYAxis(rotFactorY);.

    I hope it helps, would be cool to know if it did, if not please revert with any questions.
     
  17. GreenMartian

    GreenMartian

    Joined:
    Aug 4, 2015
    Posts:
    2
    There is no AudioClip in version 0.41.
    PlayerController: sounds are not set properly!
     
  18. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes, currently it has no sounds, because I would need to produce them myself. You can find free sounds and assign them to the prefabs.
     
  19. emmyjemmyjammy

    emmyjemmyjammy

    Joined:
    Jun 23, 2020
    Posts:
    2
    Hi! I'm eager to get back to working on my project and realize that before i add new inputs i want to make sure I have joystick controls working with my xbox controller. I see that in your documentation it says to go through PlayerInput. What would be the best way of going about that? I tried the new unity input manager but got confused.
     
  20. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Sorry for the late reply. In case you haven't figured it out yourself.
    Check the PlayerInput class at the very top you could add your a new PlayerInputDevice derived class. Check the PlayerInputKeyboard class. It simply used Unity Input class. You can do the same for your joystick controls. You can simply use code like Input.GetAxis("Horizontal"). You can find an easy setup documentation for the old way of doing it below
    https://docs.unity3d.com/ScriptReference/Input.GetAxis.html

    If you have a bigger project and think about supporting multiple controllers, I would recommend to use either Rewired from the Asset Store or learning the new, but indeed complex input system from Unity.
     
  21. lukasynthetic

    lukasynthetic

    Joined:
    May 20, 2020
    Posts:
    23
    Hello, I've just stumbled upon your assets trying to find skiing/snowboarding assets. Some questions:
    I have synty's ski pack, is it possible to swap character with the one included there?
    And would it be possible to adapt the template to skiing instead of snowboarding?
    I've read this thread and I can see the development has been progressing. Is it still active? Thank you.
     
  22. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes, should be easy, see attached documentation.

    Just rotate the model by 90°, this should do the trick, physically skiers and snowboarders behave very similar.

    I currently struggle to continue developing my tools. However, I try to provide best possible support.

    P.S.: looks like my server was hijacked, can't get it back yet, maybe it was a log4j issue, use the offline doc till it is back
     

    Attached Files:

  23. lukasynthetic

    lukasynthetic

    Joined:
    May 20, 2020
    Posts:
    23
    Hello, thanks for the reply. In this case I shall support you by purchasing the template . I'll see what I can come up with .
     
    FreebordMAD likes this.
  24. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    Where can Limit the Speed?





    and i vote for this features

    Snowboard Item Selection Screen (apparel, equipment, etc...) - 2 vote (vote more to get it back to roadmap)
    AI Players - 2 votes
    Snowboard Multiplayer (online) - 2 votes (vote more to get it back to roadmap)

    Snowboard Multiplayer (split screen) 2 votes

    Snowboard Level Editor (Multiplatform Runtime Level Editor) - 2 votes (vote more to get it back to roadmap)

    Sounds - 2 vote
    Blob Shadow for Low Quality - 1 vote
    NPC characters to race against - 2 votes
    Save the Board and Walk - 2 votes
    Last Score in the Menu / or other more complex score modes - 2 votes
    Character and Level Unlock System - 2 votes
    Fail & Fall Recovery Modes - 2 votes
    More grab animations - 2 votes
    More complex controls e.g. a second axis/joystick for rotations - 1 vote hmm
    Legacy rendering pipeline support - 1 vote
    HDRP Support 2 Votes
    Improve Docs (How To Videos, More Code Comments)
    Other camera modes - 2 votes
    VR Controller
     
    Last edited: Jan 14, 2022
    FreebordMAD likes this.
  25. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    It is currently not possible to set a max. speed limit. The limit comes from the steepness of the ground and the drag factors configured on the rigid bodies.

    The right place to add a scripted velocity limit would be PlayerPhysicsHandler.OnFixedUpdate. You could just generally add some code like below in this method.
    Code (CSharp):
    1.         if(m_cachedRigidBody.Velocity.magnitude > [maxSpeed])
    2.         {
    3.             m_cachedRigidBody.Velocity = m_cachedRigidBody.Velocity.normalized * [maxSpeed];
    4.         }
     
  26. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    Thank you
    Already tryed it there but not worked right will try yours
    So much changed already at it :)

    Also for use 2nd Player you have index settings for Player i added new Input in Script for 2nd Controller but still controlls both players with one keyboard/controller.

    Already added support for use controller and keyboard but the 2nd player not can be controlled seperate im missing something in your scripts to enable the 2nd player input Independent?


    Also if terrain to steep player not drive it's like in air and and hands up and like falling down you know why? Also at halfpipes and so on same problem


    Also found if terrain is 4097 or use more multiple terrains with 4097 or higher heightmaps and terrain then character wobbling crazy while driving and camera shaking if us terrain 1025 then its better but then cant make good looking jumps or good looking terrain

    You know how can fix? tryed much things already also changed size of damping collider etc but not helped


    Also Pipes / Halfpipes not working you not done that?
    Player jumps out


    And
    Will you add the features?


    Regards
     
    Last edited: Feb 3, 2022
  27. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Let me know if limiting the velocity worked.

    Here you need to set the player index on the PlayerController instance. The public property for this is m_playerIndex. Then you need to change how the players are assigned to different controller types in the Create method of the PlayerInput class. There you could also pass the m_playerIndex to the PlayerInputKeyboard and change the key bindings depending on it. Let me know if it worked.


    This is on purpose, however if it doesn't fit you game simply remove the line below from PlayerPhysicsHandler.OnFixedUpdate:
    Code (CSharp):
    1. m_isOnAWall = (m_playerStrl.BordUpVector - Vector3.up).sqrMagnitude >= 1.0f;
    The idea behind it is that this is for wall rides like snowboarders and skiers have in the fun parks.
    upload_2022-2-6_20-49-46.png


    Can you please double check by applying extreme smoothing (like smooth for 1min on max smooth setting). This works in my game Mad Snowboarding without issues (currently Google took it down from Play Store). The only explanation I have is that your terrain is too bumpy (or you have modified the rigidbodies).


    Could you make a little video or something like that?
    Worked for my games, e.g. Freebord The Game driven by the same physics engine setup:

    upload_2022-2-6_20-57-54.png

    Which exactly?
     
  28. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    thanks will try all

    the playerinput for 2nd player and more players now done with Rewired so can play with keyboard and gamepad and also 2 Player Splitscreen now at 1 Keyboard



    limiting velocity should work will test more at steep terrains and so on


    also i done that after dead player respawn after 3 Secs, but then he uses old velocity also will check make fall animation or stand up an only replace dead model and not destroy player model like we done in other projects

    the m_isOnAWall is better set at Tag of Object or Layer or something like the Rails, so not depending on terreain so can make WallRide Objects

    comment out the line
    Code (CSharp):
    1. m_isOnAWall = (m_playerStrl.BordUpVector - Vector3.up).sqrMagnitude >= 1.0f;
    not fixed the steep drive problem with over ground and hands in the air

    for the halfpipe problem wills end you video thank you


    i wrote you PM for some other questions thank you
     
  29. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Also here please send a video for the wallride animation. I guess you player is detected as being in air and not on the wall, but I'm not sure if I understand how your world looks.
     
  30. AkaJake81

    AkaJake81

    Joined:
    Sep 26, 2021
    Posts:
    3
    Hello,
    I had just bought this template and im getting errors with no other asstes imported.
    Can you help?

    First error
    PlayerController: sounds are not set properly!
    UnityEngine.Debug:LogError (object)
    Snowboard.PlayerController:Start () (at Assets/LapinerTools/SnowboardStarterKit/Scripts/Player/PlayerController.cs:283)

    Second error
    EndLayoutGroup: BeginLayoutGroup must be called first.
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  31. AkaJake81

    AkaJake81

    Joined:
    Sep 26, 2021
    Posts:
    3

    Nevermind, I just noticed no sound Fx came with the Template.
    Go it working.

    Thanks!
     
  32. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I'm glad you found it out, have fun ;)
     
  33. Water-tight

    Water-tight

    Joined:
    Oct 17, 2021
    Posts:
    16
    Hello, deleted previous comments as it was getting cluttered. I have a few questions and really need your help with the following:

    1. How do I remove the score system entirely? Like the speed indicator, the spinning one, everything basically.
    2. If I just wanted the actual movement script (no animation, no menu just the actual movement of the character) is there any way to go about doing this?

    Would really help with these as soon as you can. Something I also noticed when using the menu was that I'm able to choose the characters on the right, but going left from the first character to the last it doesn't work, just something I noticed.
     
    Last edited: May 7, 2022
  34. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    In the class PlayerController you will find m_scoreHandler class member variable. Delete all references to the m_scoreHandler from this class and remove the UI.

    So I guess you want to remove the score and the model handlers. Score handler is described above. Model handler works the same you will find the class member variable m_modelHandler in the PlayerController class, delete all references to it. Instead of starting the menu scene, just start the level scene.

    Don't hesitate to revert if you have any further questions.

    P.S.: if you still want to add the model, this would be the documentation:
    http://freebord-game.com/index.php/...me-starter-pack-template#doc_v1_00_characters
     
    Last edited: May 7, 2022
  35. Water-tight

    Water-tight

    Joined:
    Oct 17, 2021
    Posts:
    16
    Yes one more question. Before I was sucessfull in changing so that instead of rotating forward and back, the character rotaded side to side (this was because I changed the veichle from a snowboard to a sled). I forgot what steps I do make that (I think I changed some script value), do you perhaps have any idea on how I can achieve this? Thanks in advance.
     
  36. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    In PlayerModelData there is an option to rotate the model by 90°. Maybe it was this one?
     

    Attached Files:

  37. Water-tight

    Water-tight

    Joined:
    Oct 17, 2021
    Posts:
    16
    That rotates the model but I'm thinking the actual swining effect. The swing still happens front to back even when the model is rotated 90 degrees.

    Two last questions, there is always a light following the character, is there a way to disable this? And if I wanted to change the rotation speed of the characters (so it turns faster while going down), how would I go about changing this? Thank you again for your time.
     
    Last edited: May 13, 2022
  38. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Sorry for the very late reply.

    Regarding 90°, please try replacing the line
    euler.x += m_currEuler;

    with

    euler.z -= m_currEuler;

    in the PlayerModelHandler class to fix the rotation, depending on where you model is headed you might need to use another axis or make it positive.


    Light following the character, this is a child object on the camera, just delete it in the game scene or the camera prefab.


    Rotation speed, please check the documentation under "Player Configuration"
    http://freebord-game.com/index.php/dev-tools/snowboard-game-starter-pack-template
     
  39. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    See forum, sorry for the very late reply
     
  40. Azaahh

    Azaahh

    Joined:
    Apr 18, 2020
    Posts:
    1
    ** Edit - I'd not thought to check something as obvious as assigning the Layer type of "Terrain" to the new terrain, for any other readers who may be wondering what change was needed :)

    Hi Denis!

    I've recently bought this template and I'm trying to create new levels. I'm breaking things all over the place, and I'm hoping you can point me in the right direction :)


    Following the steps on your ReadMe: http://www.freebord-game.com/index.php/dev-tools/snowboard-game-starter-pack-template

    I copy "Level1" and create a scene. The issue I've got is with Terrain.
    If I copy the old terrain, I can't save it without overwriting the Level 1 Scene because it's linked to the 'Level 1 Terrain'.
    If I create my own terrain, or extend the existing one, the snow trail doesn't work at all. I also manage to break the lighting but I'm sure that'll be in the settings somewhere.

    So in short, if I want to generate x levels, how can I generate Scenes and Materials for them all without breaking the snow trails?


    I've attached a basic screenshot of what the scene looks like when I create a neighbour terrain. It gets assigned it's own material, which doesn't generate trails when the player rides across it.


    Cheers :)
     

    Attached Files:

    Last edited: May 27, 2022
  41. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Just wanted to note that I'm very sorry for not coming back to your question in time, while I'm glad you could figure it out yourself!
     
  42. Water-tight

    Water-tight

    Joined:
    Oct 17, 2021
    Posts:
    16
    Hello again! Thank you for the previous answer, it helped a lot. I was wondering if you think its possible to change it so you dont slow down while turning left and right (currently you slow down pretty sharply if you go fast and then turn to the side enough), and if so how to do it. If not removing it then reducing it would also be helpful.

    Btw, no problem with the answer time. Understand you don't always check the forum.
     
    Last edited: Jun 20, 2022
  43. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Analog to limiting the velocity like described in this answer: Limit Velocity
    You could instead set the velocity to a specific value in PlayerPhysicsHandler.OnFixedUpdate, e.g.

    Code (CSharp):
    1. if(m_cachedRigidBody.Velocity.magnitude > [some minimum value e.g. 2])
    2. {
    3.     m_cachedRigidBody.Velocity = m_cachedRigidBody.Velocity.normalized * [current speed value controlled by the player];
    4. }
     
  44. felixChrome

    felixChrome

    Joined:
    Jul 3, 2022
    Posts:
    1
    Hey love the asset so far!
    Really enjoy building new levels etc. .
    Im new to unity and I`ve never set up sounds / audio before. Even though it`s basic I can`t seem to get it to work.
    How to I set up both "Additional Audio Source 1 and 2 " and is there anything else I need to do?
    Thanks to anyone that can help ! :)
    Screenshot 2022-07-16 175501.png
     
  45. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Thank you very much, I'm glad it works well for you. Seeing your above comment in an Asset Store Review would help a lot ;)


    To get started with AudioSources you could check the official doc: https://docs.unity3d.com/Manual/class-AudioSource.html
    If you are more a visual type, then maybe this YouTube video instead:


    The easiest way to do it, would be to add two AudioSource components to the same Prefab object (PlayerAlive) that has the PlayerController attached. Once you added the AudioSources, link them in the same Prefab to the properties in the PlayerController script. Once you did this you need to find some sounds, e.g. on https://freesound.org/.
    Once you have the sounds you drop them into the project and assign them in the PlayerAlive Prefab to the Sound* parameters in your screenshot.

    Let me know if this did the trick for you.
     
  46. julianmauriciolema

    julianmauriciolema

    Joined:
    Apr 11, 2018
    Posts:
    6
    Hi @FreebordMAD ! Im an artist interested in buying your asset. I have very little understanding of C# coding, do you think is possible to me to put my own player 3d models and create new levels?

    Thank you!
     
  47. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Hi and thanks for your interest. Check the documentation it shows how new levels can be added and new characters integrated.
    https://www.freebord-game.com/index.php/dev-tools/snowboard-game-starter-pack-template#doc_v1_00

    Generally you can add content without coding as long as you don't want to change logic.
     
    julianmauriciolema likes this.
  48. AltIvan

    AltIvan

    Joined:
    Aug 3, 2013
    Posts:
    12
    Great asset.
     
    Last edited: Oct 8, 2022
    FreebordMAD likes this.
  49. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Sorry for not replying in time @AltIvan , did you figure out answers to your questions already or is there anything to help with?
     
  50. Water-tight

    Water-tight

    Joined:
    Oct 17, 2021
    Posts:
    16
    Hello. I wrote a couple of months ago, regarding the problem I have where I don't want the character to slow down that much when steering right/left (currently if you go really fast and turn then you character will almost instantly stop),

    you gave an example code but I really don't get it and get a bunch of error messages when pasting your code. I'm a really bad programmer and would really appreciate a more concrete example I can paste onto my project, thank you for your time.