#Object reference not set to an instance

1 messages · Page 1 of 1 (latest)

pure oxide
#

you'd have to show your code now and the full error message

#

including the filename/line number of the error

keen drum
#

i change from script to gameobject

pure oxide
# keen drum

this error means that PlanePrefab does not have PlaneScript attached to it

#

you need to make sure you put the PlaneScript on the prefab you assigned

keen drum
#

oh, i didn't know that

#

ty

#

um..... it does

pure oxide
#

show it

keen drum
#

I thought about placeobjects

pure oxide
#

show screenshots of the inspectors of these objects

keen drum
pure oxide
#

you're calling GetComponent on the root object

#

the one called BetterPlane

#

why did you put the script on a child obejct

keen drum
#

when i made it to move by mouse dragging

#

the colider from the parent

#

didn't work

#

so i made it on the child

#

the parent its made by unity. if i don't use it

#

unity draws the plane in a single cell

pure oxide
#

what?

#

Put the script on the parent object

#

the script is not the same as the tilemap

keen drum
#

I ll try immediately

keen drum
#

it works now

#

but i need to remake the colider

#

thank you

keen drum
#

a small question do you have any example of overlapbox function?

#

i don't understand what angles do

pure oxide
keen drum
#

yes

pure oxide
keen drum
#

OverlapBox(Vector2 point, Vector2 size, float angle, ContactFilter2D contactFilter,

#

last argument its for the 2nd object collider

#

right?

pure oxide
#

no it's a contact filter

#

there is no "second" object because there isn't a first object either

#

not sure what you mean by second object

keen drum
#

overlapbox

#

doesn't check if 2 objects

#

overlap?

pure oxide
#

no it checks a box shaped area to see which object(s) are inside the box

keen drum
#

ohhhh

#

and its returning an object list ?

#

with objects inside it?

#

or true/false

#

And the objects should be 100% in to return it?

pure oxide
#

depends which version you use

pure oxide
keen drum
#

do you have any idea how could i see when the planes is totally in the matrix?

#

to move it 1by1 square

pure oxide
#

I have no idea what your gameplay is like

#

but this doesn't look like something I'd be using the physics engine for

#

it looks like something grid based

#

i would just iterate over each coordinate in the object and see if they're inside the square

keen drum
#

if i made the objects from painting i can go through all tiles?

#

or i need to Instantiate all tiles in script?

pure oxide
#

I have no idea what that means

keen drum
#

i think i found my answer, tyy

#

can i access every tile in code?

#

if i made it in palette?