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
1
Question by Alex Visan · Jan 27, 2011 at 03:18 AM · javascriptreflectionballbouncepingpong

Ping Pong Reflect

Hello, i have been looking at other scripts and posts about how to reflect or bounce a ball. All of them have done me no good, I have tested and tried to make a ping pong game but when the ball bounces it is slowed down (even with drag at 0 and no gravity) and bounces in a specified direction like x, y, or z and eventually just back and forth on one axis.

The desired effect I want is for when the ball hits the wall at a certain angle, I want it to bounce back at the same angle with twice the speed(or a variable i can control).

I am a beginner at programming with java, but I understand it well. I know C# but i dont want to use it in unity as it seems java is easier and I am beginning to get the hang of it.

Can someone please help me with the code I need or give me some advice at what combinations of code I can use to get the desired effect.

Thanks :D

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
1

Answer by Jesse Anders · Jan 27, 2011 at 06:53 AM

By 'ping pong' game, do you mean an actual 3-d game simulating the game of ping pong? Or do you mean something like Pong?

If the latter, I wouldn't bother using the built-in physics system; instead, I'd just implement everything from scratch, which will give you complete control of the behavior of the ball.

(Also, Java isn't a supported language in Unity; it's JavaScript that you're referring to.)

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

Answer by Alex Visan · Jan 27, 2011 at 02:56 PM

Oh yea, javascript.

Yes I want to like the game curve ball, ive figured out everything so far except the actual bouncing of the ball. How would i implement everything from scratch? Would it not be easier to let the physics engine take care of it, and just control the behavior of the way it bounces?

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

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

No one has followed this question yet.

Related Questions

Balls bounce off wall in different ways 1 Answer

Ball Bounce with Random Range 1 Answer

How do i make a Character/object bounce using Javascript? 2 Answers

How to show a scored goal? 1 Answer

How to bounce a ball based on mouse click position? 0 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