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"

Enable/Disable Physics in Blueprints

How do I enable/disable physics (or collision) for an actor in a blueprint?

For example, let's say I step into a box trigger. I want that to enable physics for an actor somewhere in the level.

Product Version: UE 4.7
Tags:
more ▼

asked Jul 27 '15 at 04:14 PM in Everything Else

avatar image

MidiaOfficial
1 1 2 2

avatar image Flancosoft Jan 21 '16 at 02:04 AM

bump bump bump

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

1 answer: sort voted first

You first need a stored reference to the actor you want to affect. That means, when it is spawned into the world, you save that instance into a variable located in a place/blueprint that is easily accessible. For example, if you simply place the actor into the level from the editor before the game is played, select the actor in the editor, open your level blueprint then right-click into the event graph and select the option near the top that says something like "Create a Reference to (you objects name)". This will drop a reference component into the graph for the actor.

Since the level is still pretty difficult to get access too from other blueprints, you need to store this reference to the actor somewhere else. Open your custom Game State blueprint and create a new variable with a recognizable/descriptive name to the actor you want to store and make sure the variable has the same Type as the actor (i.e. if your actor BP is called MyActor then make the variable type MyActor and choose the blue 'Reference'.)

Then, back in your Level BP, get the node 'Get Game State', drag off the output blue pin and do a "Cast To (your custom Game State name)". Hook the execution of the Level BP into the execution pin of the Cast To node. From the blue result pin of the Cast To node, choose "Set MyActor" ('MyActor' being the name of your custom variable for the aforementioned actor.) Then, hook the persistent actor reference (the one you created at the very beginning of this) into the Set pin.

Now, when you enter your trigger, or however you want to get access, simply do "Get Game State --> Cast To (custom Game State) --> Get MyActor --> Set Simulate Physics" and you're done! Well, almost... One caveat to this is you will most likely need the component of the blueprint you wish to set physics on, as physics can be ran independently per component on a single blueprint. When selecting the "Set Simulate Physics" from the step above, you will most likely have multiple options for each component of the blueprint so select the one you want. For example, if you are trying to set the Mesh of a Character type blueprint, select "Set Simulate Physics (Mesh)".

Hope this helps! If it does, please accept the answer by clicking the check mark next to the answer. You will know you got it right when the answer and all its comments turn green!

NOTE: Making a comment after accepting an answer will deselect the answer as accepted

more ▼

answered Jan 21 '16 at 03:47 AM

avatar image

jtsmith
1.4k 70 29 92

avatar image jtsmith Jan 21 '16 at 03:48 AM

Also note, the process is very similar to setting collisions except instead of choosing "Set Simulate Physics" you would choose "Set Collisions"

(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