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"

Replicate Flashlight from Character

Hey guys,

I am trying to set up a flashlight that is turned on by holding the F key. It works locally but I cannot get it to replicate across clients.

Here is what I currently have as a set up:

Character Blueprint: alt text http://i.imgur.com/tLWj5aR.png

Flashlight Function Blueprint: alt text http://i.imgur.com/sYksf02.png

Kind of at a loss on how to get it to replicate. I could be close, I could be miles away from the solution.

Cheers.

Product Version: Not Selected
Tags:
more ▼

asked Oct 24 '14 at 10:52 AM in Blueprint Scripting

avatar image

Hodgeasaurus
148 15 18 25

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Try making a custom event that is set to "Run on Server". Use it twice for your F key, as you already did with your function. Also add an input for the bool. Let this event set your Flashlight bool.

Use the Event Tick with a second replicated event that Runs on the server. Pass the bool to this event too and call the normal toggle flashlight function from this event. The setup of the function can stay the same i guess.

:X This should work. :D sometimes i have a twist in my head too when thinking about the RPC system.

more ▼

answered Oct 24 '14 at 11:01 AM

avatar image

eXi
6.7k 330 181 463

avatar image Hodgeasaurus Oct 24 '14 at 11:09 AM

This in the general direction?

Still not working at this stage. Sorry to be a pain, I'm still learning this whole replication lark.

alt text

avatar image eXi Oct 24 '14 at 11:12 AM

You need to plugin the exec pin of your replicated event to the set node of the bool :D. Yes something in that way.

Check if it's working like that, if not, try adding a second replicated event that runs on the server. Use this at your Event Tick to call the Toggle Flashlight function.

avatar image Hodgeasaurus Oct 24 '14 at 11:14 AM

Well aren't I just a fool. That works perfectly. Thanks for your help there eXi. Really appreciate it.

avatar image eXi Oct 24 '14 at 11:14 AM

Haha, no problem. Just started my UE4 to make you an example, but i guess i can close it again. (: Please mark the question as resolved by clicking at the check mark at the left side of my answer.

avatar image Hodgeasaurus Oct 24 '14 at 11:15 AM

Posting to show working Blueprint for Flashlight - Thanks to eXi's help. alt text

(comments are locked)
10|2000 characters needed characters left
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