Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by yanuaris · Nov 03, 2015 at 08:48 PM · physicswall collisionmagnetwalljumpcollission

wallrun or object magnetized to wall

Need a help with scripting.

This concept is from a friend and the design is fairly simple for the moment. Only including jump, WASD and Shift.

What we concern at the moment is making and object "stick" to any walls or surface in front of them... And then as they move, they'll be magnetized or gravitate to the object's shape and trail along it as long as we hold shift.

Help? This is a core mechanic and we're in need to solve it.

alt text

Here's a diagram and concept to help you.

The basic variables need only be movspeed. Any thing else will be a product based on it.

wallrun-wall-magnet.png (409.5 kB)
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 meat5000 ♦ · Nov 03, 2015 at 01:16 AM 0
Share

What have you tried? Code examples would help.

avatar image Dave-Carlile · Nov 03, 2015 at 08:49 PM 0
Share

What exactly are you wanting help with? Need more specifics.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by iuripujol · May 02, 2017 at 08:54 AM

try using OnCollisionEnter, from there, for each collision contact, cast a ray on that direction on a certain layer (to avoid unwanted weird behaviour on unwanted surfaces) and after that use movspeed on the y axis of the tangent vector (use tangent cause it will allow you to wallrun on curved surfaces).

after that, use a timer (use as grip) which it will allow you to start and cancel the time of action (something like --> while(timer < gripTime) or you can use --> if(timer < gripTime)

and after that, in the while transition use transform.position = Vector3.MoveTowards(transform.position, yourRayCastHit.point, yourTime or movSpeed);

anyway, hope that helps, if not just send me a message:

ipctbunity@gmail.com

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

So I implemented a Wallrun into my PlayerMovement Script, but I need to press A or D to activate it. How to I make it automatic? (Script below, it's based off of rigidbody rather than CharacterController) 0 Answers

I can not get my character to crouch? Character not sliding on walls? 0 Answers

Press E to Read note 1 Answer

[UNET] Rigidbody physics sync 0 Answers

i have physics problem here!! help 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