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"

Can't Set Simulate Physics C++ [Solved]

So I have a parent Pawn who takes input to move left and right and a space bar to jump, this is then received by the child pawn and addForce is used to make the jump, but it constantly says simulate physics needs to be enabled. alt text

As you can see I set collision and simulate in code, yet in the blueprint view there isn't even the tickbox to activate physics.

alt text

What is going on?

Product Version: UE 4.16
Tags:
more ▼

asked Jun 22 '17 at 11:55 AM in C++ Programming

avatar image

Bugsy6
13 1 2 5

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

2 answers: sort voted first

First, to see all the other stuff in the Physics Pannel, you need to change the UPROPERTY from EditAnywhere to VisibleAnywhere.

Second, make sure your root is also capable of having physics enabled.

Third, I would also enable gravity.

Fourth, make sure you set up your Mesh correctly (adding collision for example).

Fifth, if it's still not working, I would try to wake up the rigid body.

Let me know if that works for you! <3

more ▼

answered Jun 22 '17 at 12:39 PM

avatar image

Ninjin
4.2k 88 38 152

avatar image Bugsy6 Jun 22 '17 at 12:50 PM

Great thanks for that, I'll give those a go.

avatar image AlexanderKim Sep 15 '17 at 10:27 PM

I had the same issue. In my case, the BP derived from the C++ class did not have "Physics - Simulate Physics" option checked. Once I enabled the check box of the BP, things started working fine. I'm confused as I thought this should've been done by default as the super class does so...

I removed below code from ABatteryPickup class and just checked the simulate physics option from BP instance worked. Strange...

  mesh->SetSimulatePhysics(true);


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

Hey thanks for the reminder. I changed the property to visibleanywhere which revealed the tick boxes for physics and gravity. I ended up adding a box collider as the root.

more ▼

answered Jul 08 '17 at 11:58 PM

avatar image

Bugsy6
13 1 2 5

(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