• 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 Dec 23, 2011 at 02:04 AM by SirVictory for the following reason:

Problem is not reproducible or outdated

avatar image
3
Question by SirVictory · Dec 22, 2010 at 06:16 AM · physicsenemyhitknockback

Character Controllers Knockback

...

Comment
Add comment · Show 1
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 Mickydtron · Dec 22, 2010 at 08:58 PM 1
Share

Why do you get slamDirection as a local space direction, but then turn it into a world space direction before using it? why turn it into a local in the first place? do you use it as a local direction in some line not shown here?

1 Reply

  • Sort: 
avatar image
0

Answer by Jason B · Dec 22, 2010 at 08:38 PM

Your mathematics are slightly complicated for the slam distance (that plus I suck at math :)) but it looks like when you're adding and subtracting those time values, it's getting added/subtracted from the vector as a whole, meaning the final movement will have force applied to all axises (mostly just the axis you want, but to a smaller degree, the other ones as well).

I may be wrong, but at a glance that's what it looks like.

Since your game is 2D (I think, right?) try specifying only the axis you intend the force to be applied on rather than the entire vector.

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Hitting an Enemy and Pushing them back 2 Answers

Make enemy Flash when Hit 3 Answers

Ray from enemy to player is always a bit off (Image) 1 Answer

How To Make NPC Follow Player When In Range? 1 Answer

how enemy tank move and hit me 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges