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"

Possess actor->pawn OK, now how to go back after 10 seconds?

OK, I'm now begging for help. This has held me up for weeks and I have deadlines I'm gaping at not reaching if I can't jump what I imagine is a simple hurdle for anyone else out there.

I have a MyCharacter actor (the default) and an actor/pawn set up called an 'Engineer'.

I have successfully managed to possess the engineer by using Event Actor Begin Overlap running from inside the MyCharacter blueprint:

alt text

So now I'm stuck inside the engineer. I've tried Timers in various ways to call functions in the engineer to possess the original MyCharacter, but what I'd prefer to do is delete the old MyCharacter object on first possession and then have the Engineer 'die' after 30 seconds and then a new version of the MyCharacter spawn in it's place with control given to it. I can then add in scoring and extras afterwards.

It's really just the mechanics of: How do I get out of the Engineer into a newly spawned version of MyCharacter?

Any advice would be welcome, please!

Product Version: Not Selected
Tags:
possess1.png (75.3 kB)
more ▼

asked Jun 18 '14 at 12:44 PM in Blueprint Scripting

avatar image

Atonnis
48 11 13 17

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

3 answers: sort voted first

I figured it out! For anyone else attempting to do a similar thing here is the blueprint..

alt text

possess3.png (187.1 kB)
more ▼

answered Jun 18 '14 at 05:56 PM

avatar image

Atonnis
48 11 13 17

avatar image VeerChidar Mar 19 '15 at 07:33 AM

how can i go back to my first default pawn from 2nd one? i struggled for hours on this nothing so far.. its getting frustrating.. help me?

avatar image Atonnis Mar 19 '15 at 09:07 AM

It does depend significantly on what you are attempting to do. What I've found works best much of the time is to cast to the 2nd pawn, possess it, and then tell the default pawn to go hidden from view (and possibly move it to a spot somewhere completely out of the way so nothing can bump into it).

To reverse the flow, just do exactly what you already did, move the default back into location, turn off hide, then cast the possession to it the same way you did the first, then destroy or hide the other, or have an AI possess it.....whatever you're actually trying to do...

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

Just spawn MyCharacter and store reference to spawned actor, then when you want to possess it - cast actor to MyCharacter and call possess on resulting variable.

more ▼

answered Jun 18 '14 at 01:18 PM

avatar image

BiggestSmile
1.6k 53 38 105

avatar image Atonnis Jun 18 '14 at 02:01 PM

What you're saying makes sense, and it's something I've tried - but I just can't make it happen via blueprints....

Firstly, how do I spawn the MyCharacter? It spawns on starting the game, but outside of that I never have reference to it.

I tried SpawnAIFromClass in the construction script so I could build a variable as a reference, as that seems to be the only operation available using spawn that comes close...so I ended up with this, which I know won't work..

alt text

I also attempted to put the setup for destroying the actor into the Engineer, but that just leaves me with an unpossessed stuck view of the horizon. Nothing I put after destroying the Engineer does anything.

I have an alternative trick I could use, that would be to attach the MyCharacter to the Engineer - which worked once, but upon attempting to destroy the Engineer after 10 seconds it always destroyed the MyCharacter part...so I gave up on that approach.

Thank you for the assist so far...if you can just please help me get my head wrapped around this one thing, so much would fall into place.

possess2.png (56.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

It does depend significantly on what you are attempting to do. What I've found works best much of the time is to cast to the 2nd pawn, possess it, and then tell the default pawn to go hidden from view (and possibly move it to a spot somewhere completely out of the way so nothing can bump into it).

To reverse the flow, just do exactly what you already did, move the default back into location, turn off hide, then cast the possession to it the same way you did the first, then destroy or hide the other, or have an AI possess it.....whatever you're actually trying to do...

more ▼

answered Mar 19 '15 at 09:06 AM

avatar image

Atonnis
48 11 13 17

(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