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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Physics Component Init Bug [4.6]

How to Repro in C++

  1. Spawn an Actor from another Actor's BeginPlay() function.

  2. Call SetActorLocation on the spawned actor in BeginPlay()

  3. Try to apply physics to the spawned actor during tick and note that physics do not work

2 Ways to get out of the state:

  1. Change any physics property on the object while the level is playing

  2. Physically change the object location with editor tools while the level is playing

Permanent workaround:

Wait a frame before setting the actor location

Product Version: Not Selected
Tags:
more ▼

asked Jan 10 '15 at 11:59 PM in Using UE4

avatar image

hyperdr1ve
593 28 51 118

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

1 answer: sort voted first

Hey Hyperdr1ve,

This is actually correct behavior and not a bug after discussing with some colleagues. Tick is called for every frame where as Event Begin Play will start once the level has loaded.

Thanks!

Tim

more ▼

answered Feb 11 '15 at 08:18 PM

avatar image

Tim Hobson ♦♦ STAFF
48.8k 887 101 878

avatar image hyperdr1ve Feb 11 '15 at 08:44 PM

This is confusing, maybe I didn't explain this very good. Is it expected behavior that if you spawn an actor and set his location in some other actor's beginplay function that you can then never ever apply physics to that object in any tick function?

I'm aware of the difference in calls to tick vs begin play, the only thing happening in begin play is the object being spawned and his location being set. After that, applying forces in tick functions is essentially a NOOP. The end result of what I'm describing is that objects spawned like this never respond to physics forces that are applied to them (regardless of where you apply those forces i.e. in tick or an input event).

avatar image Tim Hobson ♦♦ STAFF Feb 11 '15 at 08:51 PM

oh, okay. I didn't get that from the initial post. That may be my fault as well. I understood it as you were wanting to have physics start when the tick does, but it was not since the level hadn't loaded with the event begin play.

I'm not a programmer so I'll try and repro this in BP first before I bug the programmer on our team. :)

I'll let you know. Thanks for clarifying

avatar image Tim Hobson ♦♦ STAFF Feb 11 '15 at 09:14 PM

Just tested this with BP and not seeing the same. Can you verify you're seeing the same via BP before digging into code for troubleshooting?

Here is a video of my test:

https://www.dropbox.com/s/01gk6vshybckosq/PhysicsInit.mp4?dl=0

If you have a different way setup that reproduces this I'm interested.

avatar image hyperdr1ve Feb 11 '15 at 10:07 PM

After trying to make a sample project to illustrate this, I can't get it to repro either. The issue is obviously more complex than spawning and adding forces but I don't know to what degree. I guess we'll mark this as answered until I can provide a reliable reproduction case. Sorry for wasting your time here :(

avatar image Tim Hobson ♦♦ STAFF Feb 12 '15 at 04:42 AM

Not a waste of time. ;)

Let me know if you find something though.

(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