There appears to be an issue with HDPI displays and the Unity Game tab while testing the game in unity. Have had issues where the UI elements will resize and not work correctly. Issue seems to be with how Windows scales the screen.
Dropping the scaling to 100% and/or the resolution down to 1920×1080 seems to resolve the issue.
In PlayMaker you can experience issues with variables if you have a Global variable (Green in picture) and a Local variable (Red in picture) that have the same name. PlayMaker will let you select the Global variable however, you’ll get erratic behavior and it seems to revert to the local variable. Work around? Rename one of the variables.
Problem: Game would finish level, but would not load next one.
The issue was that all the levels were not included in the build scene, (File -> Build Settings -> Scenes In Build) so even though the level was correct in PlayMaker, it would not load the level in the Game window while testing.
To add scene to build, open the scene up in the editor, then open the Build Settings from File -> Build Settings… or Ctrl+Shift+B and Add Open Scenes
When you have a button object there is the On Click () area that can execute different actions like a PlayMaker script or a function in a C# script.
Issue with the C# script. You can’t drag and drop the script from the Assets Panel. The script needs to be assigned to an object, then drag and drop that object on the On Click () object. Then select the script and then the function from the drop down there.
Code snippet below is the EnableDisableAudio function that gets executed by the On Click () function above. Note that the script has to be assigned to an object, in this case the button.
Looks that the issue has something to do with the fade event not being on the camera directly. Work around is to create a FSM on the main camera to fade in when the scene starts, have a bool that gets turned to true when the scene ends. Then the FSM on the camera fades out.
The following scriptwill let an object follow a player when it is within a certain range and will stop following it once it is out of a certain range
The following variables can be adjusted from the Inspector.
Attack Speed = How fast the game object moves Attack Distance = How close does the player need to be to start moving Buffer Distance = How far away from the player should the game object stop Player = Game player to target
To use script, create a new C# script named FollowPlayer and paste in the following.
public class FollowPlayer : MonoBehaviour
public float attackSpeed = 4;
public float attackDistance;
public float bufferDistance;
public GameObject player;
if (player != null)
playerTransform = player.transform;
Debug.Log("Player not specified in Inspector");
// Start is called before the first frame update
// Update is called once per frame
var distance = Vector3.Distance(playerTransform.position, transform.position);
// Debug.Log("Distance to Player" + distance);
if (distance <= attackDistance)
if (distance >= bufferDistance)
transform.position += transform.forward * attackSpeed * Time.deltaTime;
The following picture shows the basics for create a loop that runs every second. You’ll need to create a float variable (Named oneSecond in the screen shot) that has a value of 1 for one second. Changed if desired.
Put your actions in the “Execute every 1 Second” state
Problem: When changing the shader color on a game object, the color on other game objects changes.
Reason: This happens because the other game objects are using the same Mesh Renderer as the game object your modifying. So when your changing the shader, your actually modifying the Mesh Renderer, not the game object.
Fix: Change the Mesh Renderer for the game object.
In the example picture below, when you change the color on the cube (highlighted red) the color on the capsule changes, because they both are using the same Mesh Renderer (highlighted green). To fix, change either the Cube or Capsule to a different Mesh Renderer (highlighted green)