Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Bryangs · Apr 13, 2017 at 04:26 PM · collisionbug-perhapsfirst person controllerunderwater

Strange collision bug?

Guys, i am experiencing a VERY strange bug/problem on my game. I am working on an FPS, and it took me quite some time to make a "playable" underwater mode for the standard first person character, because it uses a character controller, two scripts interacting with each other at the same time having everything on private, a kinematic rigidbody, etc... But after some hours i was able to make a underwater mode for it that disables the character controller, unchecks it's rigidbody's options and restricts it in some positions and rotations, and then add a script that will make the player move in the direction of the mouse. But, i am having a problem with adding this to two prefabs.

I have two EXACTLY EQUAL prefabs, but with different names. Now the strange thing is, with prefab n1°, i can't pass through walls when on underwater mode. BUT prefab n2° can! Wtf? How can this be even possible if both are the same thing?

#EDIT

Both prefabs have the exactly same components, same scripts, and same values. The script uses private variables to hold all the references, and changes the prefab's behavior while underwater based on that. So? This means that IF there was an error, or different behavior on each prefab by the script, i would know.

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 hexagonius · Apr 13, 2017 at 08:29 PM 0
Share

Obviously they're not, you just missed something. Layers? $$anonymous$$ovement in the wrong update?

avatar image Bryangs hexagonius · Apr 13, 2017 at 11:31 PM 0
Share

No, you didn't get it. They are literally the same thing. Same scrips, same components, same numbers, same everything. I checked everything hundreds of times, and there is absolutely NOTHING different, but one works and the other doesn't.

It's not something about movement, it's literally the fact that one prefab collides with things, and the other just doesn't for some reason, but they are the SA$$anonymous$$E.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by csalzman · Apr 14, 2017 at 01:39 AM

  • Are you sure that nothing in your scripts is referencing the name of the gameobject?

  • Try creating 4 objects, 2 from each prefab. Do they exhibit the same behaviors? Do the two that are based on the prefab that goes through walls both go through walls? What about the other ones?

  • Check that they are both using the same tags and layers.

  • Edit->Project Settings->Physics and check the collision table and make sure everything is working as planned.

And, when you figure out what's going on, please share an update! This one has me intrigued.

Something between the two is different and you'll find it eventually. Yes, I know you checked many many many times. I have been here before too tearing my hair out just to find that, oh yeah, that one little setting is off.

Comment
Add comment · Show 5 · 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 Bryangs · Apr 14, 2017 at 04:39 PM 0
Share

1°- The clones of prefab n°1 don't pass through walls, and the clones from prefab n°2 do.

2° - Same Tags and Layers.

3° - Everything on Physics is okay.

Important Note: The part on my script that SUPPOSEDLY would disable the things from the prefab, and enable some others while still making it collide doesn't work with tags, it gets the components from the GameObject it is attached to, and both prefabs have the same components and values, that's what's making me crazy! And you know what's absolutely insane? I placed both at the same time, jumped on a pool with both, and one passed through the floor, while the other don't, and everything while i was checking all the components, and everything was the SA$$anonymous$$E!

Here are two pics: One making a comparison between both prefabs, and another of the script part. alt text alt text

scriptpart.png (57.5 kB)
comparison.png (97.2 kB)
avatar image csalzman Bryangs · Apr 14, 2017 at 05:16 PM 0
Share

Throw a line in that if statement like the following:

Debug.Log("This worked")

I'm really curious to hear if it's actually firing on both of them. If so it should show up a few times in your console.

If it isn't that means that underWater and doOnce aren't getting set appropriately elsewhere in the script.

How does underWater get set?

avatar image Bryangs csalzman · Apr 14, 2017 at 05:41 PM 0
Share

I made it public for now for testing. For now it gets enabled when the player hits the Water. It detects if the object that hit it has the player tag, and then based on that activates the bool. The doOnce does exactly what it is supposed to. It makes sure these conditions are only met when the player enters the water. These are working properly, otherwise the player would see the water normally, ins$$anonymous$$d of the water effects.

Using Debug.Log worked as expected. Both prefabs show the log once they hit the water. I tried using it AFTER all the changes are set, and again, it works on both.

Show more comments
avatar image Bryangs · Apr 15, 2017 at 01:05 AM 0
Share

Again, same components, same values, same everything, including when underwater. I decided that i will delete the bugged prefab and make other prefabs based on the one that is working, and i will also report this as a bug. Question closed i guess =(

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

102 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 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

Collision Problem - Terrain collider remains flat after raising or lowering it 0 Answers

Stop Slow on Collision with FPC 0 Answers

jump on collision - first person controller 0 Answers

First Character and loose hit points 1 Answer

Why does my fps controller's motion get disabled after it collides with an enemy cube? 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