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 srafciger · Oct 30, 2011 at 01:15 AM · followpathcheckattributepathfollowing

Object following the path

Basically my question is in this image.

To be clearer I want the object,which is a ball in my case, to follow one of the paths after checking rec attribute.

If rec is greater than 80 it follows path one (green one in the picture), if rec is lower than 80 and greater than 60 it follows yellow path and if it's lower than 60 the dark red path.

Edit: Here's my current working file so you can see my current problem. Hit the ball with A with first player, and X with second player.

Edit 2: There was a problem with my upload, I accidentaly posted wrong link. Now it's OK

Comment
Add comment · Show 2
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 Bunny83 · Oct 30, 2011 at 01:19 AM 0
Share

Sorry, but i don't see a question here... more a "write-my-script-request" where Unity Answers is the wrong place.

If you search for people that want to work with you on your project go to the Unity Forums

If you have a specific question about Unity feel free to ask if you have trouble with the API or the syntax, but ask one question at a time. Be specific and include what you've done so far.

You might have a look at the FAQs

avatar image srafciger · Oct 30, 2011 at 09:58 AM 0
Share

my question was how to make object follow the path ?

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by RetepTrun · Oct 30, 2011 at 01:35 AM

Perhaps understand this script and add some if() to it

http://www.unifycommunity.com/wiki/index.php?title=Trajectory_Simulation

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 Fabkins · Oct 30, 2011 at 10:30 AM

Judging from your picture it looks like you are creating a physics based ball game. The above link from RetepTrun seems pretty helpful.

I must admit your question is little difficult to follow but taking a stab at what I think you want to do. You may want:

  • Use the built in physics engine

  • Fire the ball at a given tradjectory dependent on the position of the rect (bat?).

  • So lower the bat, steeper the angle vs vice versa (think thats how volley ball works)

I suggest this because we not really sure what you mean by follow a path. How did you define this "path".

PS I think it is unfortunate that you've been downvoted as it looks like you are putting genuine effort into this.

Comment
Add comment · Show 5 · 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 srafciger · Oct 30, 2011 at 11:24 AM 0
Share

i thought of lowering the bat and vice versa, but i was wondering is it possible to somehow create a fixed path for the ball to follow after colliding with player?

avatar image syclamoth · Oct 30, 2011 at 11:28 AM 0
Share

Why would you do that? Doesn't it make the game completely predeter$$anonymous$$ed?

avatar image srafciger · Oct 30, 2011 at 11:38 AM 0
Share

maybe, but i want to make the simple simulation first, and then input more and more paths depending on player attributes, their position on court, height, and other(add 10 or 15 more paths to these ones on picture). That way it would not be completely predeter$$anonymous$$ed.

avatar image Fabkins · Oct 30, 2011 at 12:20 PM 0
Share

@Scafciger, you are aware that you can use Unity's own physics engine?

I think to create a path is actually difficult and to make it follow it doubly so.

Create a Sphere for a ball. Then add a Rigidbody. $$anonymous$$ake the material bouncy. Thats the ball. Then just project it in a direction , the game will do the rest!

Let Unity to do the work? No?

avatar image srafciger · Oct 30, 2011 at 12:39 PM 0
Share

i've tried doing it with rigidbody , but directons the ball goes after collision are not like what was lookin for, that's why i wanted the ball to follow the path.

avatar image
0

Answer by Fabkins · Oct 30, 2011 at 04:02 PM

How are you going to define this path? You going to have to create a parabollic curve that is a physics representation of what should happen to the ball. So how are you going to create this path yet alone follow it?

I can understand and I would have expected you not to want the standard behaviour on collision with a players hands. So on collision with the player you can set the trajectory to where you want it to go.

You have two choices really in all of this.

Use the existing physics engine, tweaking it to your needs or create a new one. Seems for what you are trying to do I would use the existing one.

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

6 People are following this question.

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

Related Questions

How to make characters follow a path? 2 Answers

Problem with the climbing of stairs ( character piloted by coordinates) 0 Answers

My "Smooth Rotation" Jerks around randomly when switching between points. 0 Answers

creating path e moving object on it 1 Answer

Make objects follow main objects exact path. 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