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 AlexanderKFF · Oct 30, 2012 at 09:35 AM · movementcharacterstealth

How would I make a character flatten against a wall?

I'm making a stealth game, and one of the features I want my game to have is the ability to flatten the character's body against a wall. This is what I mean:

alt text

This is a classic stealth game mechanic, but I'm not sure how to pull it off.

This is what I have done so far:

Inline image 1

The white cube is a wall, the red cubes are invisible collision boxes, and the white cylinder is the character.

When the character enters one of the red collision boxes, a prompt appears onscreen (the shift key, for example). If the player presses that button, the character's rotational value becomes equal to the rotational value of the red cube. Each individual red cube will always be oriented to face away from the wall it's next to.

The basic functionality works, but this doesn't take into consideration things such as moving alongside the wall; the character should be able to crab-walk sideways along the wall when flattened up against it. Does anyone know what I'm talking about?

If anyone here could offer some advice on the best way to implement this feature, I would be extremely grateful!

Comment
Add comment · Show 3
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 Fattie · Oct 30, 2012 at 01:27 PM 0
Share

well you'd just need animations of the character in that position or motion.

the one and only way, pretty much, to get character animations is "buy them from $$anonymous$$ixamo, like everyone else"

$$anonymous$$ixamo is totally integrated to the asset store, indeed at the moment they are having an incredibly cheap deal

avatar image AlexanderKFF · Oct 30, 2012 at 03:36 PM 0
Share

Well, I went to college to take courses in 3D animation and I have an associate of arts degree in animation, so I think I can handle the animations myself; I've already made a few anims for this game.

The problem I'm facing is that I don't know how I should go about limiting my character's movement to "stick to the wall".

avatar image Fattie · Oct 30, 2012 at 07:46 PM 0
Share

A huge range of skills use this site, from people who don't know what "if" is in code to professionals!

$$anonymous$$otion capture is normal for the FPS sort of genre, why I mentioned mixamo .......... if it's something you'd animate yourself all the better!!

So your problem is basically finding a line of points along the wall ..

I'm pretty sure the best way to do that is using raycasting. that's normally how you send out "feelers" for anything AI-ish to find surfaces etc

So that's probably the answer

(Obviously, there could be some special situations .. like if you know it's literally norht-south or something you could literally just change the Z value, or whatever .. but that's kind of special.)

Thirdly and also very simple --it's common in places like that to very simply drop in "line markers" So drop in two empty objects ("markers" if you will) that define the start and end of a line that one of your animated characters can crab along. Write a general routine that takes two such points and makes the character behave along those.

then you can just drop "units" like that (the two markers with the script) anywhere you want in the scene

Beyond that if you describe the details of the game more, I and I am sure others are more than happy to offer other possibiltiies

As a rule "raycasting" is how you do that.

An interesting point: in ordinary car games, that's literally exactly how the car stays on the ground, knows where the ground is. You just continually raycast to the ground surface, to see where the hell it is you know, and set the suspension appropriately.

You can see that your situation is essentially the same ... but it's the wall not the road!

So that's really "the" general solution. Rock on!

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

11 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

Related Questions

Character movement range in strategy game. 2 Answers

Why am I not moving forward? 1 Answer

Third Person type Rpg movement 0 Answers

Why is Character just moving "smooth" when camera follows? 0 Answers

Children must not flip with parent. 3 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