Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to disable movement along a certain axis

I am making a sidescroller, where movement is predominantly along the Y and Z axis. However, when interacting with certain objects (for instance, when colliding with spherical or cylindrical objects), the character tends to get moved along any axis the engine deems fit, including the X axis. This is problematic, since it moves the character out of range of any objects the character can interact with.

Now I have tried constraining the player through the way I have found through the answerhub, but no luck so far. I have tried locking the translation in the bodyinstance of the main capsule component, I have tried setting up some constrains using the character movement component, but nothing I have found so far seems to work.

Does anyone know how I can permanently disable movement along the X axis and the X axis alone, for a player character?

Product Version: UE 4.11
more ▼

asked Jun 10 '16 at 09:18 AM in C++ Programming

avatar image

815 30 26 105

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Just found a solution to this problem in the Side Scroller template project in version UE 4.20. Looks like the settings you want are in the Character Movement Component under "Planar Movement":

  1. Constrain to Plane: true

  2. Snap to Plane at Start: (I've set this to true. Looks like it just ensures that position of the character on the locked axis is always set to 0 when it spawns)

  3. Plane Constraint Axis Setting: (Whichever axis you want to lock, but I've set it to "Use Global Physics Setting". I think this uses the value from the project settings: Engine->Physics->Simulation "Default Degrees Of Freedom". Since I'll want any future physics simulation to be locked to the same axis, this seems the best way to easily stay in sync with the settings.)

No idea why those settings aren't set by default for the Side Scroller template project...

I realise it's probably too late for this to help you now, but hopefully it will help others with the same problem (I found your question searching for the solution to this problem)

more ▼

answered Aug 18 '18 at 03:24 PM

avatar image

83 2 8 16

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question