Problems in Unity2D Unity:NullReferenceException: Object reference not set to an instance of an object - 2d

i have problem in Unity:NullReferenceException: Object reference not set to an instance of an object
Collectable.OnCollide (UnityEngine.Collider2D coll) (at Assets/Scripts/Collectable.cs:10)
Collidable.Update () (at Assets/Scripts/Collidable.cs:24)
In these scripts (Collectable and Collidable) I indicated that if the player approaches an object, then that object will change. Please help me.
This scripts:
enter image description here enter image description here

Maybe your script can't find the player try adding a tag to the player and then on line 10 :
if (coll.gameObject.CompareTag("tagName")){}

Related

How do I verify the presence of an image by Katalon Studio?

I have the following line of code in my program to verify that the element is an image:
if (WebUI.verifyImagePresent(findTestObject('Co-Sponsor Sign Up/Account Information/SponsorLogo'), FailureHandling.CONTINUE_ON_FAILURE)) {
WebUI.takeScreenshot()
}
When I run it, it returns the following error:
<TestCaseName>FAILED because (of) Unable to verify image present (Root cause: java.lang.IllegalArgumentException: This object don't have IMAGE_FILE property, please add it)
I have specified the object to be located by the xpath of the image:
/html/body/div[2]/div[2]/div/div[2]/div[2]/span/a/img
What I am doing wrong? What do I need to locate the image by?
To use verifyImagePresent, you have to set both Object's Properties for Object (Id, XPath, class...) and the Image file at the "Image" field to compare. You can see the screenshot below:
Screenshot link
Then you can use the keyword as normal command:
WebUI.verifyImagePresent(findTestObject("Page_HTML Images/img_workplace"))

Unity 5 NetUI - How do I fix this error?

This error message keeps showing everytime I test the game:
NullReferenceException: Object reference not set to an instance of an object
SetupLocalPlayer.Start () (at Assets/Scripts/SetupLocalPlayer.cs:12)
and I'm trying to figure out how to enable my Wheeldrive script when I am the local player (When I spawn in) and it doesn't seem to be working, The Network Id is on the player prefab but the controller script is on the Sedan gameobject, since the Network identity is on the player prefab the disable script also has to go on it, so I don't think the script is able to find the controller script since its not on the same Gameobject. (Picture Below)
Any help is really appreciated :)
The Project + Code Picture
If the SetupLocalPlayer script is on the player prefab, You should be able to find the WheelDrive component using GetComponentInChildren<WheelDrive>() instead of GetComponent<WheelDrive>() (in line 12 of the SetupLocalPlayer.cs file)
Because the WheelDrive component is not enabled, GetComponent is unable to find it. Thus GetComponent<WheelDrive>() returns null, and you get the error in the console.

Error while pressing the button " type object "my model" has no attribute "my action" - Odoo 10

I'm working on Odoo 10. When I click on the button, get mentioned error.
I want to convert a contact in partner so I need create a new line in another table with the values I put in the .create(vals).
The following links are some extracts of my code , hope you can help me.
my class : model.py
my view : model_view.xml
my error : server trace back
I don't understand your code at all. You inherit a model called test.res.partner and I don't know if you already created it. That may be the issue.
It could be also the fact that you may no be importing your model.py file if this module inherits another one that you have already created.
In general this message indicates that the method convert_prospect does not exist in the model test.res.partner.
But seeing how you write your view (like using xpath in a view that does not inherit from another one) you should rework your fundamentals.
Ah and don't call that prospect() at the end.

Facebook Open Graph Story Determiner not working

I am trying to use 'the' as the article for my object, but FB is simply ignoring it and is using 'a' instead.
When I run the object's url in FB's debugger I see all the info that's necessary. All the other properties are being used just fine.
Anyone have any idea why this is happening?
Object types cannot use "the", only "a/an". So if your determiner isn't showing when not using the object's title, that's why.

Retrieve explicit values from document library

I'm trying to pull some fields from my Document Library. Right now, I can retrieve these 2 fields to return the correct values, in my success function.
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
alert(oListItem.get_item('Title'));
alert(oListItem.get_item('UserField1'));
}
But when I try to call a computed field, such as 'NameOrTitle' oListItem.get_item('NameOrTitle')); I get IE telling me the property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
This value has content inside it right now. And I need it, as it's displaying the file name. How can I get this field? I have looked elsewhere and I have read stuff about doing:
context.load(allItems, 'Include(NameOrTitle)');
Then in my succeess function, I do oListItem.get_nameOrTitle(). Is this correct?
Well I do that and now I'm getting
Object doesn't support property or method 'get_nameOrTitle'
Please help. Thanks.
oListItem.get_item('FileRef');
Will get me the url

Resources