I have just started using Parse.com On Unity 5.0.0fb, and after getting my application to work with Parse on Unity Editor I decided to try it on my Mobile to find nothing works. I have checked the APK and Parse is inside it but when I try anything it does not work.
I have tested this with a Test APK with nothing but parse and the test script attached to a button and it also does not work.
using UnityEngine;
using System.Collections;
using Parse;
public class ScriptTest : MonoBehaviour {
public UnityEngine.UI.Text Mytext;
string mytext;
// Use this for initialization
public void MySpecial () {
ParseObject testObject = new ParseObject("TestObject");
testObject["foo"] = "bar";
testObject.SaveAsync();
mytext = "Saved";
Mytext.text = mytext;
Debug.Log (mytext);
}
// Update is called once per frame
void Update () {
}
}
It will not do anything the button will click it will say saved on my text but when I check parse TestObject nothing will be there. Is there something im missing in my build?
I have made sure stripping is also disabled.
This works 100% in editor just not in Android I have no idea or way to test iOS.
I have the exact same problem, using Unity 5.1 and Parse Unity SDK 1.5.1. It works perfectly in the editor but not on Android.
Here's my code :
ParseObject _localPlayer = new ParseObject();
Task query = _localPlayer.SaveAsync();
while (!query.IsCompleted)
yield return null;
if (!query.IsFaulted && !query.IsCanceled)
{
Debug.Log ("Player successfully created!");
}
else
{
Debug.Log("Failed to create player...");
}
The task generated with the SaveAsync() request doesn't seem to end at all (isCompleted is never true) so it becomes an infinite loop, and the actual cloud operation is not performed (no trace on the Parse dashboard). There doesn't seem to be any exception thrown and the device log doesn't show anything.
I'm really stuck at this point and haven't be able to find any solution anywhere on the web so far. :(
Using Parse SDK 1.3.2 "fixes" the issue.
-> https://parse.com/downloads/windows/Parse/1.3.2
Looks like a big fat regression. ;)
Going back to Parse Unity SDK 1.3.2 worked for me.
LogOutAsync() had to be replaced with LogOut(), but that was the only change I had to make in my code.
The solution to this problem is to reimport project settings from their blank project. It will fix any build problems you have.
The bug report, for those who would like to be kept informed:
https://developers.facebook.com/bugs/1623483557935932/
Related
I just started game development and got into a problem
whenever I load my Visual Studio code into Unity it says
The refrenced script unknown on this behaviour is missing
This is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VirtualManMovement : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log("Hello, World!") ;
}
// Update is called once per frame
void Update()
{
}
}
I need a solution for this
This may happen is the file name does not match the class name. Make sure that the file containing this script is also named VirtualManMovement.cs
Make sure in Unity you go to edit -> preferences and see that you have Unity External tools in Your IDE Selected.
Ensure your Code File Name is the same as your Class to prevent confusion.
I was confused as well when I first started. Hopefully, you find this useful
I'm a Unity beginner ,so right now I'm doing some small projects by watching some tutorials on youtube.
But, after looking at one tutorial that used the "OnTriggerEnter" function with the attribute "Collider". I realized that my editor didn't recognize "Collider" so I couldn't use "OnTriggerEnter".
I searched on the internet, but coudln't find any answer related to my question.
It's the first time, it's happened to me so I don't really know how to solve this problem...
Here's my little code, I'm just trying to move something when my player enters in a zone.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Trigger : MonoBehaviour
{
public bool opening = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
// OnTriggerEnter is called when something enter in the trigger
void OnTriggerEnter(Collider obj)
{
if(obj.transform.name == "Player")
{
opening = true;
}
}
}
So, as I said, my unity editor which is Microsoft visual studio does not detect "Collider" (I don't have the possibility to pre-fill by pressing enter for example) and the color is white and not blue like "true" for example.
So because of that I can't move forward with the project, and I'd like to know what to do so that my editor recognizes "Collider" and I can make my project work!
Thank you in advance for your answers.
To solve that you can do the following:
Close Unity and Visual Studio.
Open Unity.
Open Visual Studio from Unity (Assets => Open C# Project).
If that doesn't work you need to check your current editor in:
Edit => Preferences => External Tools => External Script Editor
Visual Studio always have some errors like missing dependencies and stuff. I would recommend using Visual Studio Code application. Just like #Jack has explained. Browse to Edit => Preferences => External Tools => External Script Editor and change your script editor to Visual Studio Code and then try again.
I've been working in Unity the last month or so. I've gotten a few iterations of a basic AR application worked up but I've updated Unity and now my code is throwing all sorts of errors.
Last week my app was working fine when building to my Pixel phone. Now that I've updated to Unity 2018.3.9, Vuforia 8.1 is now missing the name space mentioned in the title. Does anyone have any information on this?
The app will play correctly if I restart Unity up until I try to build the application to the phone. Once I build and it fails I can't replay the application due to compiler errors.
I've typed in different namespaces in the Vuforia Script and have checked my script. Mine is the same script I've used in previous versions with zero issues. I have Vuforia in the namespace but the issue appears to be coming form the Vuforia inherent script instead.
Here's the section of the Vuforia Code that appears to have the most bugs:
\\\\
namespace Vuforia.UnityCompiled
{
public class RuntimeOpenSourceInitializer
{
static IUnityCompiledFacade sFacade;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnRuntimeMethodLoad()
{
InitializeFacade();
}
static void InitializeFacade()
{
if (sFacade != null) return;
sFacade = new OpenSourceUnityCompiledFacade();
UnityCompiledFacade.Instance = sFacade;
}
class OpenSourceUnityCompiledFacade : IUnityCompiledFacade
{
readonly IUnityRenderPipeline mUnityRenderPipeline = new UnityRenderPipeline();
public IUnityRenderPipeline UnityRenderPipeline
{
get { return mUnityRenderPipeline; }
}
}
class UnityRenderPipeline : IUnityRenderPipeline
{
public event Action<Camera[]> BeginFrameRendering;
public event Action<Camera> BeginCameraRendering;
public UnityRenderPipeline()
\\\\\
I'm not versed enough in C# to know the fine tunings of QC'ing the code other than the immediate lack of ";" in a lot of these lines.
What the app should be doing is building correctly to my phone. Once there it's an application that reads a sketch I drew, and shows a model or several renderings of the space based on the image target and virtual buttons placed in Unity.
Hello
Not sure how you created your app, but these errors look similar to ones you'd get if there was a mismatch between the Engine SDK version and the Vuforia samples. As the SDK evolves and APIs are created/changes, so do the samples to be compatible with them. Here's how you can check the versions of both (assuming you used Vuforia samples resources):
- SDK version: Unity Editor->Window->Vuforia Configuration.
- Samples version: Unity Editor->Project window: Assets/Vuforia/version.
also, you can delete the old version of Vuforia and re-import from the Package Manager in Unity.
Thanks,
I am trying out Unity for my Game Design course, but I can't seem to get the code to work. I suspect it is because Visual Studio (which I write my code on) is not connecting to Unity properly, and here's why I think this:
For one thing, whenever I try to put the code on an object, it prints out this error:
Can't add script behaviour CallbackExecutor. The script needs to derive from MonoBehaviour!
This is despite the fact that nowhere is the code called CallbackExecutor, and the script apparently does derive from MonoBehaviour.
Second, when I load up the code onto Visual Studio, I get this error message:
C:\Users\cemya\Documents\D&D Roguelight Project\Assembly-CSharp.csproj : error : The project file could not be loaded. Could not find file 'C:\Users\cemya\Documents\D&D Roguelight Project\Assembly-CSharp.csproj'. C:\Users\cemya\Documents\D&D Roguelight Project\Assembly-CSharp.csproj
The problem is I don't know why it's not connecting. There's no option to import the package (which implies it's already imported), and I do have a package for Unity.
I'm using Visual Studios 2017 (specifically, I'm using the 2d setup most of the time), Unity version 2018.2.4f1, and the package is called Visual Studio 2017 Tools for Unity [Experimental], which is what was automatically downloaded when I began to set up coding for Unity. Since I got this version automatically, I believe that this should be a common problem, but I can't seem to find real answers on it (I even asked on the Unity forms themselves!)
I can show you the code if you think that would help.
UPDATE: I have just updated Unity to 2018.2.5f1 and tested it with the code that has actual code. All that happened is that the name for the error message is different:
Can't add script behaviour TMP_CoroutineTween. The script needs to derive from MonoBehaviour!
Also, here is the code for the one I'm testing, if it helps:
public class RollScript : MonoBehaviour
{
Random rand = new Random();
int r = 20;
int m = 5;
// Use this for initialization
void Start ()
{
int rolling = DieRoll(r, m);
print(rolling);
}
// Update is called once per frame
void Update ()
{
}
int DieRoll (int roll, int mod)
{
int get = rand.next(1, roll);
int result = get + mod;
return result;
}
}
UPDATE 2: I have checked with visual studio, and the error message there isn't there anymore, so that's an improvement.
UPDATE 3: I have created a new project and I have not run into issues there. I guess the problem was the code's connection to older editions.
This Can't add script behaviour TMP_CoroutineTween. The script needs to derive from MonoBehaviour! error has been mentioned in a few places on the internet, but with no satisfactory answers. This seems to be the only StackOverflow question about it.
I suspect it happens when there are un-fixed compile-time errors while you're adding a script to a GameObject. I had this problem just now, and after I fixed the errors, I was able to add the script. However, I tried to confirm this by adding a syntax error and then adding a script, but I still didn't get the Can't add script behavior error. So that's odd, but if you're encountering that error, I suggest fixing any compile-time errors and see if that works. (Whether it works or not, please reply to this question with the result.)
This is my code:
public class CrazyWindow: EditorWindow
{
[MenuItem("Window/CrazyWindow")]
public static void Window()
{
EditorWindow.GetWindow(typeof(CrazyWindow));
Debug.Log("It should have appeared!");
}
string test = "";
public void OnGUI()
{
test = EditorGUILayout.TextField ("Text Field", test );
}
}
I'm using Unity3D v. 4.3.4f1 (free version) on Windows 7.
I have no idea why this is happening, as I can see in tutorials in the internet, that's how it should be done. The script is also in the Editor folder.
I'm able to click on the option "CrazyWindow" in the window menu, and I also get the Debug message informing me that the window should be working, but nothing happens besides that. No window is created at all!
What might be the cause of my problem?
Problem solved.
As Bart mentioned, I was using a custom Editor Layout, which was the case for the window not showing.
I just switched to one of the factory editor layouts and: ta dah, the window was there...
Pretty buggy thought.
Try renaming the 'CrazyWindow' part in the MenuItem and of the class itself. Unity remembers whether a window is visible or not and somehow something goes wrong there. Probably it thinks your window is visible (in cache) while actually it is not.
As Bart said, it remembers useless things
Just make it remember what we want it to
private void OnLostFocus() {
GetWindow<CrazyWindow>().Close();
}