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 Change Root Component Type

Hi, I've been having a problem for a while that I can't find a way to resolve on my own, and haven't seen anything on the forums that adequately addressed it.

I use a parent class (item_carryable) which contains the logic for items in my game (which is the vast majority of objects that aren't static in the map) so that you can pick them up, attach them to your character, and so forth. The item_carryable class has uses a Static Mesh as a root. Whenever I make new items derived from it, I just change the model in the field and it works fine.

However, I have a number of items (bags, furs, etc) that I need to be skeletal meshes. Unfortunately, there is no way that I can find to change the type of the root component from Static Mesh to Skeletal Mesh for the child. This becomes a problem because then I have to make the skeletal mesh be a sub-component of the Static Mesh root which is, well, nothing. This means I can't enable or disable physics in any way that doesn't break the whole thing - if I enable physics on the static mesh, it's an empty component that does nothing except maybe fall through the world. If I enable physics on the skeletal mesh sub-component, it immediately becomes separated from the actor it belongs to, because it detaches from the root, which leads to more bullcrap down the road.

The aforementioned reason is also why I can't use a Scene Component as the root, for example, because that can't handle physics properly. Is there any way that one change the root mesh from the static to the skeletal, either in the editor or in blueprints? If there is a C++ way, I'm also open to hearing it

Thanks

Product Version: UE 4.12
Tags:
more ▼

asked Aug 25 '16 at 03:15 AM in Blueprint Scripting

avatar image

DylanBrady
71 7 12 18

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

3 answers: sort voted first

So, without knowing how many children you have. You can easily just keep the StaticMesh as the root, set physics to it (have to assign a mesh), use THAT to move, while keeping it Hidden In game. The Skeletal Mesh will move along with it. Just tested it and that works.

If not, you have to redesign your whole system from scratch.

more ▼

answered Aug 25 '16 at 03:39 AM

avatar image

VictorBurgos
2.4k 61 27 113

avatar image DylanBrady Aug 29 '16 at 10:17 AM

Hey guys thanks for the responses, sorry I was busy and forgot to check the responses on here.

I did think about doing that system of creating a static base that is hidden with a skeletal model on top of it, and may end up using that - though I wonder if there would be any additional performance costs to having 2x the number of props in those cases? Probably not enough to be a big concern though.

Also making 2 actors that implement the same interface may be a good approach. I'll try both of those out and see if they are going to be what I'm looking for. Thanks again guys

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

you could make ItemCarryable into an interface, then make 2 pickup actors that implement that interface: ItemStatic and ItemSkeletal. then any communication you would normally do with the base class, can be done through ItemCarryable interface functions.

then, if you decide you want to carry a character or a vehicle as if it were a weapon, you can just let them implement ItemCarryable.

more ▼

answered Aug 25 '16 at 03:52 AM

avatar image

ScottSpadea
9.6k 320 205 450

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

Answering question live: https://www.twitch.tv/victorburgos_

more ▼

answered Aug 25 '16 at 03:25 AM

avatar image

VictorBurgos
2.4k 61 27 113

(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