Manual Achievements not working for me - First time using Epic games plugin for Unity #524
Replies: 7 comments 3 replies
-
Hi @BakiStudio, I assume that you've taken a look at the Achievements Demo? Your first screenshot has me a little confused. The correct syntax in C# would be the following: // the value of this would have to be the "achievementId," whatever value that
// might be (from the Epic Online Services Developer Portal).
string level1_completed;
var achievementManager = EOSManager.Instance.GetOrCreateManager<EOSAchievementManager>();
achievementManager.UnlockAchievementManually(level1_completed); The achievement manager can be found here: Let me know if any of the above sheds further light on the situation or not :) |
Beta Was this translation helpful? Give feedback.
-
Hello @paulhazen , Yes I looked but got confused really fast so I research some issues here on github and tried to make something. Thanks for the correct syntax. This is my current changed script: However in the Unity console I am getting this error after clicking the button which should unlock achievement - NullReferenceException: Object reference not set to an instance of an object |
Beta Was this translation helpful? Give feedback.
-
@BakiStudio, it looks like you're doing everything correctly. However, the file Can you share your Everybody starts somewhere, this is how you learn! :) |
Beta Was this translation helpful? Give feedback.
-
Hello @paulhazen, Yes I understand. The whole MenuController script is just public voids methods for buttons nothing connected with EOSAchievement etc. These are the main lines with connection to EOS plugin. using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using TMPro;
using PlayEveryWare.EpicOnlineServices.Samples;
using PlayEveryWare.EpicOnlineServices;
//EpicGamesStore
private EOSAchievementManager achievementManager;
public string level1_completed;
private void Awake()
{
var achievementManager = EOSManager.Instance.GetOrCreateManager<EOSAchievementManager>();
}
public void UnlockAchievement()
{
// This line is throwing a NullReferenceException
achievementManager.UnlockAchievementManually(level1_completed);
} In hierarchy there is a
Thanks for any help and advices! Have a nice day. |
Beta Was this translation helpful? Give feedback.
-
Try adding the following line inside your achievementManager = EOSManager.Instance.GetOrCreateManager<EOSAchievementManager>(); Also, from what I can see your variable public string level1_completed = "level1_completed"; |
Beta Was this translation helpful? Give feedback.
-
FYI - I moved this to be a discussion, as this is a better forum for continued discussion :) You were not incorrect to open an issue, but I think we have concluded that there is not a bug, but I'd like to continue to help you get this working for your game. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello!
Is there anybody who could help me with setting manually achievements for e.g Level 1 completed and it will trigger the achievement?
I am kinda lost with this plugin, I tried to follow some old issues here but they didnt worked.
I have something similiar with Steam API but Steam was way more easier than this. I want to reach something like this:
![obrázok](https://private-user-images.githubusercontent.com/157118130/298121802-6a2a17f5-5b81-4274-9994-3b07cc4604fc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0NjIxNTgsIm5iZiI6MTcxOTQ2MTg1OCwicGF0aCI6Ii8xNTcxMTgxMzAvMjk4MTIxODAyLTZhMmExN2Y1LTViODEtNDI3NC05OTk0LTNiMDdjYzQ2MDRmYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyN1QwNDE3MzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02N2I5MGMzYzQyNmFhZmZhZmFiMWFmNGE0MTY3Yjk3MmFmOGE1MWI3ZDVmNmY5ODJmZGRiNmYwZDIwMTI1YzQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7nZiUgj9DYRpv23qG7cl7hgD1H7KOyfUIsz0CiEtNIg)
Thanks for any tips or advices.
Beta Was this translation helpful? Give feedback.
All reactions