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 mcslibin · Jun 02, 2014 at 09:16 PM · collisionpushgrabpull

How to Check Collision When Pushing / Pulling Object in 3D Space

I am currently trying to develop a FPS push/pull (in 3D space) mechanic with the following requirements:

  • Player must "grab" object

  • Player must face object's center to grab it

  • Object should turn with player (stay in front of player while turning - partial orbit)

  • Object can be pushed or pulled

  • Object should move with player

  • Object must account for collisions

  • Object moves freely along X/Z (no grid)

  • Object must be able to fall when pushed off ledges

I've managed to solve for most of these requirements by using a rigidbody with gravity on the object and a kinematic rigidbody on the player. I connect the object to the player with a Configurable Joint to get the desired movement, but collision is still causing me grief.

I'm currently using a "crate" for testing that is 1.5x1.5x1.5, meaning that it's wider than the standard FPS player. When I move the player up against a wall (from the side), the crate starts to "climb" in an attempt to align with the player's Z, especially when the player starts turning towards the wall.

I would like to implement collision in such a way that when the crate can no longer move in a particular direction, neither can the player. Any ideas on how I can do this?

Comment
Add comment · Show 3
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 mcslibin · Jun 09, 2014 at 04:18 PM 0
Share

Been working on this for days, and still no luck. I've been trying a different approach than the one I initially asked about.

I'm using the limit property of the configurable joint I'm using to allow the object to catch on corners in such a way that when the player leaves a secondary collider on the crate it breaks the joint and the player "drops" the object, not unlike how catching an object on a corner in Portal works.

Having more luck trying this way, but still not there yet because of how allowing for a limit on the XZ keeps the crate from moving with the player.

Any thoughts still more than welcome.

avatar image christoph_r · Jun 09, 2014 at 09:18 PM 0
Share

Ins$$anonymous$$d of a Configurable Joint, would maybe applying Force depending on the distance of the player work? If the player is further away, the force would point towards the player, if the player gets close the force pushes the crate away.

avatar image mcslibin · Jun 11, 2014 at 06:23 PM 0
Share

I've thought about trying to use AddForce, but the issues I run into with that are: 1) I don't know how to adjust the force to accurately match player movement speeds 2) Since the object is supposed to act like it's "grabbed" it needs to always be close to the player until it has been released by the player or by collision that pulls the object away from the player

0 Replies

· Add your reply
  • Sort: 

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

22 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

Related Questions

Prevent a specific RB to influence another, but still collide with everything 0 Answers

Play animation when 2d character hits collider. 0 Answers

Child Colliders 0 Answers

Pulling objects 2 Answers

Cube collision problems when held 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