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"

How to possess another actor

I have a button, which is an actor with an "event interact" I followed the answer here:

https://answers.unrealengine.com/questions/228791/change-character-color-in-multiplayer.html

But I can't get the reference to the other actor. The actor is just a duplicate of the main actor which is used for the FPS first person character. This idea as far as i understand, it gets the player array , casts it to a controller and then posesses the pawn which is the other actor? My goal is that when i interact with the button actor, that it switches to another actor.

alt text

Product Version: UE 4.16
Tags:
more ▼

asked Apr 04 '19 at 10:12 AM in Blueprint Scripting

avatar image

hue.pitastrudl
1 1

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

1 answer: sort voted first

The anwser the person there gave you use level blueprint which is not really recommended and reason why you can get reference.

You need actor reference by other means, if you spawn actor dynamically, spawn node returns reference to actor, keep it and use it to posses, if you have actor already on the level make actor register yourself to actor of that blueprint you showing, all server side.

The answer from other question also ignores a lot simpler possibility of using material parameters:

https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/HowTo/Making_Parameters

You give your character a player ID, for example make variable, make it expose on instance, place actor on level and set the variable in property editor after you select the actor. Now in blueprint in construction script you would set material parameter to change the color. Use whatever you use to determent which player actor is. Remember this need to be client side and in client you dont have access to otherp layers player controlers and game mode, use either player state or set it preemptively via construction script.

more ▼

answered Apr 04 '19 at 11:28 AM

avatar image

Shadowriver
35.7k 926 168 1104

(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