Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 James73 · Oct 03, 2012 at 06:23 AM · playerplatformhowlaunchair

How Can I Make A Platform Lauch My PLayer Into The Air?

I'm trying tot make a game like redball and if you have ever played redball you would see that there are platforms that lauch the ball into the air. How can I copy this.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by SarperS · Oct 03, 2012 at 06:34 AM

I don't know Redball but you can add a trigger volume to that platform, once the player triggers the volume, you can set the Y velocity of it's rigidbody to something high enough to shoot the player into the air. Gravity will take care of the rest.

Comment
Add comment · Show 6 · 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 bigdaddychez · Oct 03, 2012 at 06:47 AM 0
Share

can i use this code to change the velocity of an object upon collision? whats the code for prefor$$anonymous$$g such an action?

function OnTriggerEnter (other : Collider) {

//need code to change velocity here

}

avatar image SarperS · Oct 03, 2012 at 07:06 AM 0
Share

other.rigidbody.velocity.y = 10;

avatar image James73 · Oct 03, 2012 at 11:10 PM 0
Share

Thank You I haven't tried it yet but it sounds like it will definitely work.

avatar image James73 · Oct 03, 2012 at 11:21 PM 0
Share

Haha, it actually didn't work. I wrote my script like this:

var LaunchHeight = 8; function OnTriggerEnter (other : Collider) { other.rigidbody.velocity.y = LaunchHeight;}

Then this errors occurs:

NullReferenceException: Object reference not set to an instance of an object

I might add that my player has character controller not rigidbody.

avatar image SarperS · Oct 03, 2012 at 11:25 PM 0
Share

Well you never mentioned it was a character controller, please post your movement script and let's see if you have jump controls, if you utilize the Y component of your movement vectors, you might be able to alter that jumpspeed high enough to achieve that jumppad effect.

Show more comments
avatar image
0

Answer by Dark44Mod · Mar 09, 2017 at 05:42 PM

Try adding a tag to the platform called "launcher" or something like that and then in your player controller script: add an if statement that would check the tag on the platform and inside the if statement add a rigidbody AddForce to move the player up. Something like this (I am NOT an expert so, loosely follow this):

     public float VerticalForce1 = 10f; //Change this for your launching power
     Vector2 VerticalLauncher = (0, VerticalForce1);
     void OnTriggerEnter2D(Collider2D other) 
     {
         
         if (other.gameObject.CompareTag ("launcher"))
         {        
             rb2d.AddForce (VerticalLauncher);
         }
     }
Comment
Add comment · Show 1 · 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 SarperS · Mar 09, 2017 at 06:53 PM 0
Share

Did you realize that this question is 5 years old? And your answer is basically the same with $$anonymous$$e, the OP is not using a Rigidbody so this wouldn't work.

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.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Launching player with cannon 2 Answers

How Can I Make a Bouncy Platform? 1 Answer

I can't export my project to adobe flash player platform ! 1 Answer

how to make a player with magnet like effects?? 2 Answers

Moving Platform and CharacterController.Move not working. The player falls 3 Answers


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