top of page

Making a Racing Game Framework Part 6

 

Next we need to create some form of way we can see who is in the game, and be able to run commands on our server and clients seperatly and replicate information thats needed. We can replicate our variables by selecting the variable and choosing replicate or RepNotify from the Replication selection. 

If our variable is Replicated it means that the data stored within it will be the same for the Server and the Client, if its set to RepNotify this will generate a function which will be called every time the variable is edited as well as being Replicated.

 

However we will need to call certain things on the server and certain things on the client, (For example player A doesn't have all of player B's data, so if player A interacts with player B they must tell the server they wish to interact / get the server to do the interaction for them)

 

We can call these things using RPC's (Remote Procedure Call's) To create them within Blueprints we must use Custom Events 

 

When changing our custom event we can choose from "Not Replicated, Multicast, Run on Server & Run on owning Client"

Not Replicated - This is self explanatory and isn't replicated at-all (This is the default for custom events)

Multicast This should only be called from the server but it executes all code behind it on all clients and locally on the server too

Run on Server - This can be called from clients and servers but it only executes the script 

Run on Owning Client - This can be called from clients and servers but only executes any script locally, this is similar to the Not Replicated option.

 

 

© 2023 by Web-Designer. Proudly created with Wix.com

  • s-facebook
  • Twitter Metallic
bottom of page