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 /
This question was closed Sep 24, 2013 at 01:52 AM by clunk47 for the following reason:

OP resolved issue.

avatar image
0
Question by ViktorEisenmann · Sep 23, 2013 at 01:22 AM · movementcharactercontrollerquaternionnormalsalign

Script Stopped Working - Walking on Walls

Hello all! I got a weird bug here...

I was using this code "Walking on Walls", and it was working just fine. The character rotates and "sticks" to the wall.

On the next day, the script wasn't working anymore! The character rotates, align to wall's normal (and should stay in this position to walk on the wall), but when it finish rotating, the character returns to it's original rotation, and then sticks to the wall.

Can anyone help me? I did not change the code in the meanwhile. Actually, I did not created any other code, tags, layers, prefabs or names that could possibly interfere, I was just creating the level.

Comment
Add comment · Show 4
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 magnusOP · Sep 23, 2013 at 05:06 PM 0
Share

did you update unity? that can cause a problem. post your codes you think are interfering.

avatar image ViktorEisenmann magnusOP · Sep 24, 2013 at 12:07 AM 0
Share

Nope.. I didn't update Unity. And I don't have other codes interfering actually. HEELP! =(

avatar image clunk47 magnusOP · Sep 24, 2013 at 01:51 AM 0
Share

Please don't post comments as answers.

avatar image ViktorEisenmann · Sep 24, 2013 at 12:57 AM 0
Share

I found where the bug is, but I still can't fix it.

 function JumpToWall(point: Vector3, normal: Vector3){
     // jump to wall 
     jumping = true; // signal it's jumping to wall
     rigidbody.is$$anonymous$$inematic = true; // disable physics while jumping
     var orgPos = transform.position;
     var orgRot = transform.rotation;
     var dstPos = point + normal * (distGround + 0.5); // will jump to 0.5 above wall
     var myForward = Vector3.Cross(transform.right, normal);
     var dstRot = Quaternion.LookRotation(myForward, normal);
     for (var t: float = 0.0; t < 1.0; ){
         t += Time.deltaTime;
         transform.position = Vector3.Lerp(orgPos, dstPos, t);
         transform.rotation = Quaternion.Slerp(orgRot, dstRot, t);
     //   Debug.Log(t); 
        yield; // return here next frame
     }
     myNormal = normal; // update myNormal
     rigidbody.is$$anonymous$$inematic = false; // enable physics
     jumping = false; // jumping to wall finished
 }

The bug is when transform.rotation gets from the orgRot to the dstRot. When it happens, my character gets back to original rotation and sticks to the wall.

1 Reply

  • Sort: 
avatar image
0

Answer by ViktorEisenmann · Sep 24, 2013 at 01:51 AM

Found the bug! I was using Mouse Look. The weird thing is... it was working fine few days ago...

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

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

Basic movement. Walking on walls. 8 Answers

CharacterController, Move toward mouse 1 Answer

How do i rotate based on direction character is moving in 1 Answer

Align plane to normal but keep Y-axis intact 1 Answer

8-Axis 3D Top Down Movement 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