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 orangeflame · Aug 09, 2013 at 03:20 AM · rigidbodycollidercharactercontrolleristriggeriskinematic

Rigidbody bounce or character controller istrigger issues

I have an object that is an object that is suppose to be a fish and has a rigidbody and sphere collider and it, of course, bounces around if it hits any object with a collider since I have disabled gravity. After looking on Google I found out I could use the character controller to get around this but my istrigger based script functions don't work. Even though, I have a sphere collider with istrigger checked. Though the reason is currently slipping my mind, I was having trouble with a previous problem that could only be solved by using istrigger and I can't use the collision function. Also, I know I could use iskinematic or freeze rotation and position to stop it but now my object will go through walls and I also don't want that either. any ideas?

EDIT: OK maybe the above explanation is a little vague. So basically I have a fish swimming around underwater shooting bubbles and collect food to become stronger. there are also areas of rushing water that will push this fish around. I also have code set up so I can add a versus mode later. My problem is that when this fish hits a wall I simply want it to not go through or bounce off it or even continues to increase in speed in the direction opposite of the wall until it hits another wall. I simply want it to stop the fish from going through the wall. here the whole list of code I have for the movement. Note: I have a lot of commented out code I have leftover from trying to figure out other problems.

DELETED

EDIT2: I have fixed this by adding the code below to Late updater.

rigidbody.velocity = new Vector3(0f,0f,0f); rigidbody.angularVelocity = new Vector3(0f,0f,0f);

But now I got a new error message saying

Actor::setLinearVelocity: Actor must be (non-kinematic) dynamic! UnityEngine.Rigidbody:set_velocity(Vector3)

I personally don't care since I got what I wanted (unless this turns out to be an actually problem) but this error message is really annoying.

Comment
Add comment · Show 6
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 Peter G · Aug 09, 2013 at 03:33 AM 0
Share

Describe bouncing around. Do you have any physics materials on them?

avatar image clunk47 · Aug 09, 2013 at 04:07 AM 0
Share

This doesn't really make a whole lot of sense. It's bouncing around. Ok, WHAT DO YOU WANT IT TO DO??? lol

avatar image orangeflame · Aug 12, 2013 at 01:44 AM 0
Share

one thing I may have forgot to mention is that this fish is controlled by the player and moves around using transform.position += speed*Time.deltaTime. I have no physics material on it and I basically want it to stop when it encounters a wall not slow pick up speed moving in the opposite direction of the wall until it hits another wall.

avatar image Peter G · Aug 12, 2013 at 01:47 AM 0
Share

Change transform.position to rigidbody.position.

avatar image orangeflame · Aug 12, 2013 at 02:13 AM 0
Share

Nope still bouncing around but it appears to also jerk back and forward now. here is a sample of the code I'm using: Forward = Input.GetAxis("Forward1");

rigidbody.position += transform.forward* (trueSpeed*Forward)*Time.deltaTime;

Show more comments

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

17 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

Related Questions

Activate physics when animation ends 0 Answers

attached.Rigidbody isn't working with a ChactacterController? -1 Answers

Picking up items with Rigidbodies 2 Answers

How to make jump something without using a character contoller? 2 Answers

mesh colliders problem 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