Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
2
Question by DILLAghost · Sep 23, 2010 at 05:00 PM · freewalkingwallsonparkour

Walking on walls?

I want a game where buildings and things are climbable like the game [prototype], the way it would work is that if youre pressing the Z key you enter free-run mode. Im fairly new to scripting and only know JavaScript, tutorials would be apreciated so I can get it fixed into my head and maybe prevent me from asking more questions than I need to.

                                                 -Thanks in advance

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 alexnode · Sep 23, 2010 at 09:13 PM 0
Share

I want to do that too... you have to write your own character controller. in a simple way I guess you want when you collide to a wall the forward input key to be translated to the upward input key. $$anonymous$$irror's edge had a much more complicated structure where each of the grip points were behaving differently. Great stuff.

avatar image Matt-Downey · Jun 25, 2012 at 01:02 PM 0
Share

what's with the free tag?

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by skovacs1 · Sep 23, 2010 at 09:08 PM

To run up walls isn't bad, but gets trickier depending upon how you implement your running in the first place.

The simple solution is to raycast in the direction you are running and align your animations to the surface if it is within a certain distance (the distance you'll be moving in the current frame for example). If you add inertia or anything like that, you'd want to consider that too.

I recommend looking at the locomotion system for more on aligning animations to a surface.

Raycasting is simple.

var hit : RaycastHit;
if(Physics.raycast(transform.position, moveDirection, hit, amoutToMoveThisFrame) {
    //align yourself to hit.normal as up
}

Also, since you know that the normal you're aligned to is not the world up, you can do smart things like balancing the weight against the surface (wall running la Prince of Persia).

You should also take into account collisions and the character's lean if they lean into their running animation.

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
avatar image
1

Answer by aldonaletto · Sep 22, 2013 at 02:46 PM

Take a look at my answer to this question:

http://answers.unity3d.com/questions/155907/basic-movement-walking-on-walls.html

It posts a script that allows a rigidbody character to walk on any surface - it even jumps to a wall if close enough.

Comment
Add comment · Show 1 · 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 stephen_gregory · Nov 26, 2020 at 10:56 PM 0
Share

Good answer!

avatar image
0

Answer by Sejersen · May 03, 2012 at 07:15 AM

Another "easy" way to do this, using Unity's charactercontroller is by using "Slope Limit". It's a build-in function which allows you to change how high a slope your character can walk, run or climb. - I know this isn't exacly like PoP but it's a start, right? :)

Hope this will help :)

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
avatar image
0

Answer by Matt-Downey · Jun 25, 2012 at 12:51 PM

I'm always late in answering questions on Unityanswers, but...

 function Pace (normal : Vector3, vect : Vector3)
         {
         //By dot product/negative inverse, this is orthogonal to the normal
         var right : Vector3 = Vector3(normal.y,-normal.x,0); //in world space
         var forward : Vector3 = Vector3(0,-normal.z,normal.y); //in world space
         right.Normalize();
         forward.Normalize();
         
         //the direction the player will move (tangential),
         //which is a combination of any two non-parallel vectors on the correct plane
         var direction : Vector3;
         direction = right*vect.x + forward*vect.z;
         direction.Normalize();
         return direction;
         }
 
 function GetMoveDir (horizontal : float, vertical : float) //The basic user-input function, which calls subsequent f(x)'s
     {
     moveDir = Vector3(horizontal, 0, vertical);
     moveDir.Normalize(); //makes sure the player can't travel @ 1.41x diagonally
     }
 
 function FixedUpdate ()
     {
     GetMoveDir(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"));
     }

The first function takes in the "vect" from "GetMoveDir," all you have to do is insert the "normal" from a raycast.

Should work 100% of the time if I copied the right bit.

Also, I always use Translate(vector, Space.World) or more recently Rigidbody.MovePosition, Translating an object with respect to itself gets annoying during jumps, as you have to recalculate every--single--frame.

This will work on walls and ceilings. It'll work as you expect on walls and floors, but if I'm not mistaken, ceiling controls will be inverted.

I wrote all this myself, so I should know the fine details a little better, but w/e.

Comment
Add comment · Show 1 · 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 winner1324 · Sep 22, 2013 at 02:37 PM 0
Share

Hi, I was wondering how exactly to get this to work. I have tried almost every kind of combination of movement, but nothing seems to work. Could you please tell me what kind of object this has to be attached to?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Walking On Walls With Mouselook! 3 Answers

Enemy walking through walls/terrain 1 Answer

FPS walking inside of a cylinder 1 Answer

How to make enemy walk on walls, while go toward player? 6 Answers

Unity 3D Java - FPC Side Walking Through The Wall Problem 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