Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by GregPDesUGD · Aug 01, 2016 at 03:00 AM · transformtriggerparent-childspherecollider

Why is the scale for a Sphere Collider radius not matching that for Transform?

I am taking a look at my sphere collider for my enemy paddle in this 3D clone of Pong to see if my minimal speed limit in the X-axis of my ball is high enough so that it intersects the collider when moving towards the north wall, exits the collider right before it hits the north wall, and then afterwards, goes back to the collider.

The sphere collider I'm using is actually a trigger for the paddle to detect the ball, and in this case, to predict where the ball will be (in terms of Y) by this X position, which is where the paddle is. I'm going to use raycasting and simple scaling on the reflected vector (if it hits a wall) to predict where the ball will be within the opponent's strike zone.

But there's something peculiar on how the sphere collider radius is set up. My paddles are set 4 Unity units away from the origin, I have my sphere collider set with a radius of 17.5, where in the Scene View, the collider that goes beyond the player's paddle is not passing through the far edge of the playing field, which is 10 Unity units long (my enemy paddle is sitting one Unity unit away from the edge of it.)

I don't know what this is, but I feel like my sphere collider radius in values of Unity units is 8.75 and not 17.5 as I figured.

Wondering if this has to do with my scale for the paddle itself, as the sphere collider is the child of the paddle.

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 smnerat · Aug 01, 2016 at 04:38 AM 0
Share

I'm confused by your question, I'm not sure what your asking? If you want your sphere collider to be the same size as your sphere transform/mesh, the colliders radius should be 0.5f. Any value smaller than 0.5f and the collider will be smaller than the sphere object, while any value larger than 0.5f and the collider will be larger than the sphere object.

The collider will scale with the transform automatically. The collider radius should be 0.5f whether your transform scale is Vector3(1, 1, 1) or Vector3(10, 10, 10).

avatar image GregPDesUGD smnerat · Aug 02, 2016 at 02:31 AM 0
Share

If I set my ball detector radius (which, like I said before, is a sphere collider with a trigger) to 9.0, it only reaches as far as 4.5 Unity units, which is just past the midpoint of the game board. I have to set it to 18 in order for the collider to reach the board's left side.

Not sure why that is?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Quakeee · Aug 01, 2016 at 09:01 AM

Use a mesh-collider instead.

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 GregPDesUGD · Aug 02, 2016 at 02:33 AM 0
Share

Not sure why when I think a mesh collider would only wrap around the opponent's paddle.

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

80 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 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 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 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 avatar image avatar image avatar image avatar image

Related Questions

Cant get setParent to actually set the parent for child. 0 Answers

Weird Child-Parent behavior 0 Answers

How to turn off isTrigger when on Entering and turn on isTrigger on Exiting. 1 Answer

How can i make my object go back to its start position? 3 Answers

Object moves when game starts, but shouldn't until player collides with trigger 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