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 angad singh · Oct 18, 2010 at 11:54 AM · colliderfrictionphysicmaterial

need platforms to move character with them, not take the character through them

i've uploaded my rubik's cube scene here:- http://www.megaupload.com/?d=9OC7306C

now the problem i have with this is, the colliders just don;t work like i want them to!! the character can stand on the box, but if he's next to it and th box moves, the box goes through him!!

in this scene, to test what im talking about, start rotating the top slice of the 5X5 Rubik's cube by pressing 'e' and 'r' (the key to change slices is 'y'). you'll see that the slice rotates, but the character doesn't!! that's problem 1. (i even applied some phyics materials with loads of friction, but it doesn't work)

the second problem is, that when the character is made to stand on the little part jutting out in the slice just below the top slice, while rotating, the slice goes through him!! that's problem 2 (the problem with the collider)

here are the pictures:-

pic 1: Standing on part jutting out alt text

pic 2: after rotation, a cube goes through him, grrrr... alt text

i got this script attached to the character controller, and i have the white cube tagged as 'PlatformX' to work with it, doesn't work!!:-

function Update () { }

function OnTriggerEnter(t: Collider) { Debug.Log("On trigger enter in " + gameObject.name); if (t.gameObject.tag == "PlatformX") { gameObject.transform.parent = t.gameObject.transform; Debug.Log("Parented"); } }

 function OnTriggerExit(t: Collider)
 {
     Debug.Log("On trigger exit in " + gameObject.name);
     if (t.gameObject.tag == "Platform")
     {
         gameObject.transform.parent = null;
         Debug.Log("Unparented");
     }
 }

This script was partly supposed to fix Problem 1 (all i had to do was tag all the platforms 'PlatformX'). Which it didn't. And Problem 2 just baffles me, any ideas????

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by spinaljack · Oct 18, 2010 at 01:16 PM

Character controllers don't react to physics, nor do they cause physics reactions in other objects (you can't push a block with just a character controller)

You need to detect collision with OnControllerColliderHit and then make the effects happen by script i.e. move the character away from a moving platform or add force to a block you're trying to push

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 Atnas1010 · Nov 02, 2010 at 01:22 PM 0
Share

or use a rigidbody ins$$anonymous$$d of a charactercontroller

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

Wheel has no friction on mesh collider of another GameObject. 0 Answers

Wheel Collider General Friction 1 Answer

Forklift pallet physics 3 Answers

Put PhysicMaterial on my Gameobject befor destroying it? 1 Answer

Turning a sphere collider into a character Motor 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