x

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 can I stop my Physics Body from being affected by other Physics Bodys without constraining movement?

MyCharacter from Side Scroller template had Collision Presets set to Pawn and disabled "Collisions Enabled", which made other falling objects just fly through my character, completely ignoring it. So I changed Character's collisions to custom preset and and then "Collisions Enabled" to "Collisions Enabled".

The rest of the objects now collide with my character even when they're WorldDynamic or PhysicsBody. But there is one bad thing with this solution (bad in my case)

In my game each object has it's own Vector3 gravity, so I can control if it falls down, flies up or sideways. Player can just control whether object falls down normally or has "inverted gravity" and flies up. Example setup:

1 - Character with "No Physics Collision". Player shoots platform - it flies up. Player can walk around that platform with no problem.

alt text

2 - Character with "Collisions Enabled", same thing but platform's rotation get's affected by mass of character. Clumsy player falls off platform:

alt text

Of course I understand that this is how physics work. But can I apply these two into my character:

  • Things that fall on character should not ignore it's collider component (bounde off, not intersect)

  • Set Character's mass to 0kg (?) so Its collider couldn't affect other objects as described above.

One answer would be to constrain object's rotation but I would like to avoid that. I'm already constraining all physics objects to 2D plane (movement on Y, Z and only one rotation)

Product Version: Not Selected
Tags:
more ▼

asked May 16 '14 at 04:11 PM in Using UE4

avatar image

Zielak
235 8 14 18

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

2 answers: sort voted first

Hey Zielak,

You might want to consider using matinee to move your platforms, and basically fake your gravity change. Otherwise, constraining the rotation is probably the best option. Setting your character's mass to 0 might have other unintended effects on your game.

If you'd like, I can take a close look into the issue if you show me specifically how you are moving your platforms up and down so I can reproduce it.

Best,

Ben Halliday

more ▼

answered May 16 '14 at 05:35 PM

avatar image Zielak May 16 '14 at 06:21 PM

Hi Ben,

The platform inherits from my Obstacle blueprint so the usage is not restricted to up/down platforms. Here's the setup:

Collider properties:

  • Simulate Physics - true

  • Enable Gravity - false

  • Collision presets - BlockAllDynamic

One Vector3 variable called "Force". Default value negative Z (0, 0, -15). In my case player can shoot his gun and invert Obstacle's Force (0, 0, 15). For simplicity you could bind inversion to some keyPress.

In Obstacle events graph I have On Tick event: alt text

MyCharacter is taken from SideScroller template, the only thing I changed here was to Enable Collisions, as I mentioned earlier.

fake_gravity.png (61.3 kB)
avatar image Ben Halliday STAFF May 16 '14 at 07:28 PM

You could try increasing the Angular Damping by a large enough amount. In your Collider's physics settings, increase Angular Damping to something like 50 and see if that helps.

avatar image Ben Halliday STAFF May 21 '14 at 12:50 PM

Hey Zielak,

We haven't heard from you in a few days, so we're going to mark this as the accepted answer for tracking purposes. If you're still experiencing the after the above suggestions, please let us know!

Best,

Ben Halliday

avatar image Zielak May 22 '14 at 09:28 AM

Well, that could be my design flaw. I wanted to make every obstacle act the same but maybe I just have to restrict some obstacle's movement so they can act like elevators. Thanks for your time.

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

for 1) doesn't the standard pawn collision preset work? 2) To set the mass to 0 kgs, expand the physics tab by clicking on the arrow and set mass scale to 0 or you can just search for mass scale and set it to 0 for the mesh and capsule component.alt text

capture.jpg (160.3 kB)
more ▼

answered May 16 '14 at 05:10 PM

avatar image

HypnoticShark
617 23 29 47

avatar image Zielak May 16 '14 at 05:36 PM

1) No, only from "below". When I throw stuff at him from side or above it just goes through it.

I'll try that mass scale in a moment.

avatar image Zielak May 16 '14 at 05:59 PM

No luck, setting mass scale to 0 keeps situation from my seconds screen.

(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