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. 

Spawn Actor from Class

Hello, I'm new to unreal, I've created a weapons-picking system, and I have a problem with laying the weapons, I duplicated some weapons and created a variable class to spawn the weapon I got, so when I try to spawn, nothing happens . help!!

alt text

alt text

alt text

alt text

alt text

they are in the same class, they are children of the same father.

Product Version: UE 4.21
Tags:
img-1.png (119.4 kB)
img-2.png (25.3 kB)
img-3.png (164.7 kB)
img-4.png (103.7 kB)
img-5.png (23.6 kB)
more ▼

asked Jan 08 '19 at 03:24 PM in Blueprint Scripting

avatar image

lucasapds
1 1 1

avatar image dabs863 Jan 09 '19 at 02:06 AM

for me i use a blank parent actor with a structure of all the details including class and then write all the code in the main and pass it to the children class and it works perfectly if you want details let me know

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

1 answer: sort voted first

Does the output log show any warnings or errors related to spawning? Is the return value of the SpawnActor node empty? If not then are the location and scale values what you'd expect?

more ▼

answered Jan 08 '19 at 04:34 PM

avatar image

ZoltanE
1.6k 79 94 145

avatar image lucasapds Jan 09 '19 at 01:27 AM

alt text

doing so worked perfectly. alt text

doing so worked perfectly.

That way I got this back, I wanted me to return the guns for the class. I must be doing it wrong. Sorry for my English.

img-6.png (112.0 kB)
img-7.jpg (122.1 kB)
avatar image ZoltanE Jan 09 '19 at 05:54 AM

It is good practice to store the spawned actor reference instantly in a variable so you don't lose track of it. Something like this:
alt text It greatly helps readability and debugging.

In any case the "Accessed none" messages indicate that things did not go perfectly at all. :) It could be that the spawn location is inside colliding geometry. Using a shape trace (https://docs.unrealengine.com/en-US/Engine/Physics/Tracing/Overview) you can check that the location you intend to spawn the actor has room for it. Or for a quick hack you can just set the Collision Handling Override param to "Always spawn, ignore collisions" and see if that helps.

avatar image lucasapds Jan 23 '19 at 02:23 AM

Thanks, it worked.

(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