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 lil_billy · May 12, 2011 at 11:41 PM · physicscolliders

colliders and physics

so im sure this is a rather simple problem

but heres what i have

i have a player with the basic FP controls and then i have a custom made AI

now they both have their respective colliders, i believe the character controller has a default collider

now my bear AI

i have it set up so that if a player enters his range he will pause and then pursue the player and when the player enters his attacking range he will stop and attack the player (because of the way i want my game i have it so if the bear catches you you are owned which means when he does i have it so i locks down the players controls and camera[so they can watch helplessly as they are turned into a human chew toy])

now my problem is if the bear starts chasing me and i try to run away he will eventually catch up to me and i enter his attack range when that happens my controls do lock out however for some reason my player continues to move for like 5 feet then stops even though the player has no control and because of the way i have it, i have to have the bear stop when he attacks

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 Michael 16 · May 13, 2011 at 02:33 PM 0
Share

Can you show the bear's code? I think I can help you to make the bear stop when he attacks.

avatar image lil_billy · May 13, 2011 at 04:31 PM 1
Share

its like 200-300 lines of elaborate and poorly organized code plus 7 links to world interactions

-he stops, thats easy, its the player that continues moving -since i couldnt fix the player from doing that i made a work around that makes the bear move again if the player leaves his attack sequence

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jpmythic , developer, programmer, technician · May 26, 2011 at 01:33 PM

I believe that has to do with Physics.. The forward momentum of the player needs to be zeroed out when you stop him. This can be done by getting current velocity and reversing it and adding that as a force to the player.

Just started with Unity so cant give you the specific code, but I dealt with this issue with another engine.. The Physics friction can also slow them down as well.

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

1 Person is following this question.

avatar image

Related Questions

Is there a way to automatically make physics collider frictionless on sides but not on top? 2 Answers

Too sensitive GameObjects 1 Answer

Box vs Capsule collider for player 1 Answer

Hinge Joint Effected by Colliders 0 Answers

Problem with Colliders 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