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"

Control actor after destroyed and spawned?

How would I take control of a new character that I spawn after the current one has been destroyed?



Product Version: Not Selected
more ▼

asked Feb 22 '15 at 08:23 AM in Blueprint Scripting

avatar image

30 12 9 12

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

1 answer: sort voted first

Take the return value of spawn actor, get the controller, and make the controller possess the new pawn.

more ▼

answered Feb 22 '15 at 10:48 AM

avatar image

396 17 13 34

avatar image Mr0dd Feb 22 '15 at 11:04 AM

How would I create that new pawn?

avatar image zamy Feb 22 '15 at 11:10 AM

you are already doing it with the "Spawn Actor My Character" node. Simply create a node to get the controller, and call Possess on the controller, passing in the new pawn.

avatar image Mr0dd Feb 22 '15 at 12:17 PM

I did that and when the actor respawns, the camera stays at the death point and the controls don't control the actor.

avatar image zamy Feb 22 '15 at 01:59 PM

post a new screenshot. Anyway, you should destroy the actor AFTER spawning and getting the control on the new one.

avatar image Mr0dd Feb 22 '15 at 07:22 PM


blueprint.jpg (170.2 kB)
avatar image lonerider543 Feb 23 '15 at 04:06 PM

You need to provide the pawn which you want to possess. Right now you're just telling the controller to possess nothing. Simply connect the output of the SpawnActor with the pawn input of the possess node. :)alt text

possess.jpg (416.9 kB)
avatar image Mr0dd Feb 23 '15 at 09:18 PM

Still doesn't work, the camera still sits there where the death occurred and it seems as if the new pawn isn't being possessed.

avatar image Mr0dd Mar 15 '15 at 03:27 AM

Bumping question.

(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