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"

Seem to be having a casting issue

I'm attempting to have an item equipped on the player via a socket, i think it may be an issue with the way I am attempting to attach a specific item through the cast as I am referencing the master item blueprint (which the item in question is a child of) unreal doesn't throw any errors, however it will not equip an item to the socket. Kinda scratching my head on this one pretty hard, any advice would be greatly appreciated. Let me know if you need any further screen shots. Thanks in advance.

alt text

Product Version: UE 4.11
Tags:
1.png (178.7 kB)
2.png (8.6 kB)
3.png (129.7 kB)
4.png (257.7 kB)
more ▼

asked May 31 '16 at 07:35 AM in Blueprint Scripting

avatar image

Nejibana
7 2 4 5

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

1 answer: sort voted first

you need to cast the player character first, then you can get the mesh from it. however i prefer to do the attaching on the construct (that way you can see if its properly attached too) and ingame just change the static mesh value of the weapon or w/e you are using. remember, if you dont cast, you only have access to the parent class, if you want variables inside your own made BP class, you have to cast.

alt text

attach.jpg (685.2 kB)
more ▼

answered May 31 '16 at 11:42 AM

avatar image

jblaswu
813 22 11 46

avatar image Nejibana Jun 01 '16 at 06:49 AM

I've tried what you've suggested and it's still doing nothing. I'm referencing a static mesh in a parent blueprint to equip a mesh from a child blueprint. This action is being called from a custom event in the parent item blueprint. Is it because it's not part of the construction script in the actual player blueprint? if so how would you get the proper cast from an actor event?alt text

5.png (97.9 kB)
avatar image jblaswu Jun 01 '16 at 07:39 AM

have you tried the attach node on the construct of the character? does it shows it properly attached? also if what you want is to show a weapon or item on the slot, you should just attach it since the beginning and assign the static mesh upon equip, or add a child actor, attach it on the character blueprint on construct and set the class on event.

avatar image Nejibana Jun 01 '16 at 08:31 AM

I realized part of my problem was i didn't have a skeletal mesh set on the character bp itself. setting it by default doesn't seem to be an issue at this point but calling it from a custom event is still not working

avatar image Nejibana Jun 01 '16 at 08:38 AM

You helped me immenselyalt text buddy and i appreciate it, i think all i have left at this point is to properly reference the master BP so i can use different weapons but here's a screenshot of the code fix called from an inventory button. Thanks big time.

6.png (119.9 kB)
(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