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 to add physics to character (Being pushed by force)?

Hi!

I have a question concerning physics on characters. In the game I'm currently working on, the player has to shoot platforms so they can expand. Some of them go out really fast and I planned in my level design that they, for example, shoot the player in the air if he stands on one and shoots it. So in other words, the player would fly off in the air for some time.

The problem is, for now, no matter how quick the platform moves when going up, or on the side, and the player stands on it, he just stays on the platform, like if he was glued to it. So I wondered if there's a way to enable physics on the character, so that when he gets pushed by something, he flies off in the direction he was pushed?

I tried looking into the Character Movement, in the Character, I tried changing some values, but for now, I haven't found anything.

Thanks in advance, and if you need precisions, just let me know!

Product Version: UE 4.9
Tags:
more ▼

asked Jan 14 '16 at 11:49 PM in Blueprint Scripting

avatar image

Maxime Vézina
15 7 7 11

avatar image jtsmith Jan 15 '16 at 07:04 AM

What values have you tried changing? Should be as simple as checking the box 'Simulate Physics' then whatever force you have "push" the player, like a projectile, ensure it has an impulse setting (impulse is for a moving object like a projectile.) The higher the impulse (which loosely is it's velocity with an added force) the more the object gets "pushed" or moved by the instigator (see the First Person Template for an idea of how a projectile knocks back the blocks in the level using impulse.)

Also ensure that all relevant collisions are set to "Block" the proper type of object (i.e. Pawn "Blocks" Projectile and Projectile is set to "Block" Pawn.) For not projectile objects, simply using the right collision combinations should solve the issue (i.e. a low ceiling pushes the player off the moving platform if he doesn't crouch under it.)

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

1 answer: sort voted first

Sadly, when you activate ''Simulate Physics'' on the character, you lose control of it and can't move. I guess it makes sense. But thank you for the suggestion!

I've actually managed to make it work by using Add Impulse on the character movement, but it's very manual and tedious because I have to tell the direction in which to impulse for each platform.

So I'm still curious if there's an automatic way to put force/impulse physics on a character, I would find it surprising that there's no way to do it.

more ▼

answered Jan 15 '16 at 06:17 PM

avatar image

Maxime Vézina
15 7 7 11

avatar image BennehR Feb 09 '16 at 08:25 AM

This is pure speculation as im only just a beginner, but heres my two cents

Could you not make somthing where when you trigger a custom event (shooting the platform) it toggles "simulate physics", you apply the impulse and then toggle the simulate off again, you could use delay nodes to help with this, i think if you used a sequence node you could trigger the physics and impulse almost simultaneously and with a brief delay after the physics toggle, toggle it back on to regain control

like i said im a total beginner, is there any logic to this? xP

avatar image Maxime Vézina Feb 09 '16 at 07:29 PM

Maybe it could work, but the Add Impulse already does what I wanted it to do :P Your suggestion is pretty similar to my solution, with Simulate Physics added, but then again, you have to ''hard-code'' it a bit. But thanks for the suggestion!

(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