• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by joechessum · Nov 25, 2013 at 06:20 PM · c#2djumpbeginnerjumping

Super Ghouls 'n Ghosts style jumps & double jumps?

Hey everyone,

I'm very new to coding and build games in general so please try to overlook how terrible I am but I need some help coding a jump and double jump system that replicates how the jumps are in the classic Super Ghouls 'n Ghosts. The code I have right now creates a jump arc to the right, left & I also have a 'neutral' jump but this code uses rigibody2d.AddForce which means its not exactly the same everytime. This also means when I added a double jump the player was just nudged instead of given a new speed and direction.

Can someone give me an idea of how I can replicate the system from SG'nG in c#?

Thanks in advanced!

Joe.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image iwaldrop · Nov 25, 2013 at 07:43 PM 0
Share

Post your code!

avatar image unity_xYnMukOS02_bXQ · Aug 31, 2021 at 06:03 AM 0
Share

Whenever I use PlayerRb.velocity = new Vector3(0, 1, 0); I only ever get vertical movement even if i change the value of the x to PlayerRb.velocity = new Vector3(1, 1, 0) nothing happens on the x when i jump. Could someone explain to me why this doesn't work or what I'm not understanding?

avatar image unity_xYnMukOS02_bXQ · Aug 31, 2021 at 06:30 AM 0
Share

Hey joechessum

I've been trying to code this jumps on and off for months and keep giving up and trying to do it again but i can't seem to get it could you please help me with the code or at least understand what I need to do in order to at least do a single SGnG styled jump.

avatar image Spinnernicholas unity_xYnMukOS02_bXQ · Aug 31, 2021 at 04:47 PM 0
Share

Do you have any other scripts that are modifying the x velocity, like a player controller script?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Spinnernicholas · Nov 26, 2013 at 09:54 PM

Instead of using AddForce. Try changing the velocity directly.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image joechessum · Nov 28, 2013 at 04:43 PM 1
Share

Ah yes I changed it to rigibody2D.velocity and now have the jump and double jump sorted. Cheers!

avatar image aceleeon5 · Jun 29, 2014 at 05:29 AM 1
Share

Any view on the code? I'm interested in seeing what it looks like!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

,How to disable autojumping when holding spacebar? 4 Answers

Max height jump 1 Answer

Character Won't Jump 2 Answers

2D boomerang effect 1 Answer

Triple Jump C# Script 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges