#πΌοΈβ2d-tools
1 messages Β· Page 52 of 1
when they're instantiated, when they're near each other, when they pass over each other... whenever you want
thanks a lot man π
When I push the pause sign in the unity editor, is it possible to inspect an object so I can see private members from a script and what values they might contain ?
if you mean private variables you can serialize them to view/edit them in the inspector. Just add [SerializeField] where you declare the variable
Is it meant to show in the Inspector then ?
Yes. serializing fields will make them show in the inspector
Thanks! π
I'm trying to make a click animation in a mouse sprite by using two sprites, one normal and the second with the left click highlighted, so i fade the normal sprite to 0 or 100 to make the click animation.
(Using DOTween)
So this is my code:
public void Click() {
ClickOn();
}
public void ClickOn() {
print("Click on");
mouseNoClick.DOFade(endValue: 0f, duration: 0.8f).OnComplete(ClickOff); //mouseNoClick is the normal sprite.
}
public void ClickOff() {
print("Click off");
mouseNoClick.DOFade(endValue: 100f, duration: 0.8f);
}
But i get this:
Only the click on animation works the first time (the click off animation doesn't even works)
Answer ^ if you can first, but does anyone know if Composite Collider 2D changes the collider shape if a tile is destroyed?
And I guess a more pressing question, does anyone have any ideas what is going on with these colliders?
The colliders are what you see, but I don't know why the actual collision is happening so far away from the actual collider on the player
Changing the box collider's shape does influence the collision but I can't figure out why the shape of the collider doesn't seem to match up with the collision
Like if I make it smaller, it functions as if it were smaller, but the collision still doesn't match up
what does the collider of the wall look like?
I turn it on at the end of the gif
On the player I have just a Box Collider 2D and a Rigidbody 2D
And on the wall I have a Tilemap Collider 2D, a Rigidbody 2D, and a Composite Collider 2D
try changing the defaultContactOffset in Project Settings > Physics 2D to a smaller value
That worked wonders! Thank you!
I have a super simple dialogue system where contact with a point or clicking an object takes you to a Scene/Level with the dialogue but how I can place an animation on the canvas it takes you to? (Just a simple idle animation for the character youβre talking to)
does anyone know how to make a joystick go beyond just 8 directions?
can anyone help me i have 3 errors in unity. Unity packages and this error is comming everytime in am reopening any scenes in unity :(
try updating your 2d sprite package
in package manager
Oky thnx for ur reply.. :)
@snow willow bro i am now even able to open the package manager its whole empty π
try to restart unity and pc if still not working
If I have a tilemap with a tilemap collider, can I make it so that some tiles can colllide and some don't?
One way you can do that is create a new layer on the tilemap and put all the collision tiles on there and put the tilemap collider on that layer only.
Yeah but I'm looking for a different solution
This is my script, I wanted to make the gameObject desactivate after its complety but dont work π¦
It will really rarely be equal to full time as Dalphat said, you need to check if it's >= instead
oh ookok
Update is called each frame (if you got 10 fps, it will be called 10 times a second)
According to that, if your fulltime variable is equal to 2f, that time = 1.98 but that one frame took 0.1 second to calculate, you'll never fulfill the condition :)
ohh ty ty >D
Ah, guess I need rest; good catch.
i already fixed it, ty guys
Don't worry, it's friday xD
I have an unresolved issue with UI elements inside a Scroll View where they don't take the full width of the screen when I set the UI Scale Mode of the Canvas to Scale With Screen Size instead of Constant Pixel Size.
So, what I want to remove is the space on the left and right sides, or these two areas highlighted in red.
It should look like this.
does the scroll view stretch to each edge?
It seems so.
what about the content object
That one too.
have u set the right pixel size as reference
also try using expand
I've set it like this. I think I've used a reasonable reference resolution
try changing the screen match mode to expand
I don't see any improvements after changing it to expand
even after resetting the messages and entering play mode again
mess around with shrink or match as the other settings
sorry i don't know too much cus with ui i usually just try lots of different things and see what sticks
it's a little fickle
I agree and understand. The number of objects in the hierarchy that may be causing the issue is not helping either.
the button "sizes" (the white outline around it) is too big so I can't click any of the other buttons. Does anyone know a way to make it so that the button only works when I click the actual sprite?
you need to set your width and height to be the size that you want for the clickable area
that changes the button sprite size though
oh, because your sprite has a bunch of transparent space in it
you need to crop your sprite to be just the button
also, it is common to use 9-sliced sprites for buttons so that the sprite will fill the button area
you can make one sprite for the main button area and a separate sprite for the drop shadow if need be, though I think you can probably slice it so the shadow scales correctly
with the drop shadow combined into the main sprite, the drop shadow is always going to be clickable. If you want only the gray area to be clickable, you'll have to make two separate sprites and put them on different GameObjects (and use parenting to make them look the same as the shadow the way you have it now)
oh alrighty
hi, I'm having a really hard time coding my ground checker. it's a boxcast attached to my character's feet and it works pretty well in general.
the problem is that when I pass through a unidirectional platform (which uses an effector) the ground checker's boxcast detects the platform before the jump is over. so the ability the jump again and the idle animation is trigger.
I can't find a way to restrict the boxcast to one direction like an effector does.
(i have fixed the problem by checking the velocity of the player at the same time i check its ground checker boxcast)
My Code doesnt work. Anything i am coding just doesnt work. I cant even give out something on console.
Can someone help me in vc or somethign
You probably have compile errors you need to fix
But "doesn't work" is very vague and hard to go off
Anyone familiar with AIPath? I'm trying to implement it following most of this tutorial, https://www.youtube.com/watch?v=jvtFUfJ6CP8 , and I have it working.. only my gameobject doesn't seem to follow the trajectory the ai has detected.. π
Let's learn how to make 2D pathfinding using A* with and without code!
β Check out Skillshare! http://skl.sh/brackeys17
β A* Pathfinding Project: https://arongranberg.com/astar/
Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·
β₯ Subscribe: http://bit.ly/1kMekJV
π Check out Line of Code! https://lineofcode...
If I wanted to create a game where tapping the screen was it's core mechanic (in a mobile game), how should I best implement touching the screen? The UI engine with abutton? raycast hit? something else? I want to be able to pull off fast,consecutive touches
Input.GetMouseButtonDown(0) works π
Any ideas why my entity doesn't follow the A* calculated path ? https://www.youtube.com/watch?v=yZt6ZFIzHw8 . I am simply setting AIPath.destination to try and trigger movement
Does anyone know how to make a animated objects to scale with screen size? I can't figure it out, they are sprites that are animated on background
Its just one static photo that is animated, no movement in the game
https://docs.unity3d.com/ScriptReference/Screen-dpi.html
u can get screen.dpi and then use that to scale the object's size
Thanks I will try to look on this π
Hello, I got a question. How can I make the shadow caster 2d dynamic? It only lets me create the shape of the shadow caster shape. Cant I do it dynamically? Like with the alpha mask of the sprite?
Thanks!
I got a really strange bug related to 2D tilemaps. Let's say I set 3 tiles of type A, and after I place over them 3 tiles of type B, on exactly on the same spots. After placing the last one, all tiles disappear. If I set one more tile anywhere else, the tiles that disappeared become visible. Any idea what's going on here?
Calling tilemap.RefreshAllTiles solves the problem
Hello ! Im not quite sure if i can ask help here but it's related to a 2D game so i guess it's OK. I just wanted to ask if i can create like Tower Of Hero made by Tatsuki (of course, it is for my own utilisation, i don't plan of making it public) with Unity and if yes, is there already a tutorial or do i just need to experiment myself (it's my first time using Unity) ?
- Never heard of that game
- Any game is possible in Unity
- I doubt there is a tutorial to create an exact existing game
Ok thank you ! If you say that any game is possible in Unity i believe you ! Im gonna do some experiment then
Is it correct to be using a layering system to try arranging hitboxes and hurtboxes? As an example, I want to have the same detailed hitbox/hurtbox/pushbox system utilized in games like Guilty Gear (examples being framedata like http://www.dustloop.com/wiki/index.php?title=GGACR/Slayer#Hitboxes ) but more for a beatemup like system.
So far I can foresee issues being that, in order to have a layer like "Friendly/Allied/Player hitboxes" and "Enemy hurtboxes" and "Enemy Hitboxes" it seems like I would need multiple game objects associated with one entity or character in order to achieve the proper layering. As such, I'm a bit skeptical that this is the correct idea but it may be resolveable with proper object pooling.
Direct example - I could have them all attached to one gameobject but that sounds like it requires a lot more work checking what the trigger is actually colliding with in comparison.
Hi guys, im new at unity and im making a game like zelda , i wanted to know how can i make an ammo system (with an hud in top right corner?)
I already have the arrow script, the ammo hud
i just need to script it but i dont know where i should start
Thank you! ^_^
So i made the script
But now how could i attach this script to another script? i already have my main player script where its make the arrow by pressing "m" button
can some one help me? i wana put that new item that spawned in that GameObject called "newItemSpawn" but idk how
someone help plz?
Cache the result of the instantiation
Set your parent to it afterwards
var Set New Item Spawn = Instantiate(...);
Set Parent(Set New Item Spawn);
```*Not actual code*
hmmmmmmm
Or rather remove var if it's a class member.
ill try it later thnxxxxx
There are a lot of ways to handle this and all of them probably add more complexity than you'll like. Off the top of my head this is what I'd do:
-
Create an interface (eg IHittable) and make every character type inherit it. This interface should define OnHitBox, OnHurtBox, OnPushBox methods.
-
Put each of these different triggers on child game objects in each character. Give each a HurtBox.cs, HitBox.cs, PushBox.cs as appropriate. These classes will be simple so you'll be able to reuse them in each character.
-
In each of these scripts, on Awake, find the IHittable in the parent object. Then forward the collisions with OnTriggerEnter2d(Collider2d other) => parentHittable.OnHitBox(other)
-
Now your character can define specific responses to each type of collision. Safe it as a prefab and you have the basic character ready to go
why my bullet gets more slowed as more time the method is called?
Thanks! I'll give it evaluation tonight/tomorrow and see how I feel about my possible approaches.
I honestly would implement my own collision system without relying on physics. It's just a bunch of simple square intersection checks anyway
true
Does AddForce do anything when gravity is zero ?
It does. You can think of gravity just as another AddForce call
How can I match the scale of a UI image to a sprite in the scene?
Try googling βhow to scale ui to match sprite unityβ @chrome wind
Easiest way is to have a screenspace-camera canvas and then just position the UI element in worldspace.
I'm sure you get a lot of people who don't but might I suggest not assuming so readily that people just haven't tried googling things?
Ye. I just had a talk with some friends and they mentioned making a second canvas for that. I honestly didn't consider that I should have multiple for something like this so thought I was just sorta picking my poision with which type I used.
The reason to make it screenspace-camera is you can guarantee that it's aligned with the camera that is rendering the sprite
It doesn't even need to be a second canvas, it can be the same one you render everything else on.
Up to you.
Alight. Thanks I'll look into it. π
Hello, I got a question. How can I make the shadow caster 2d dynamic? It only lets me create the shape of the shadow caster shape. Cant I do it dynamically? Like with the alpha mask of the sprite?
so for some reason the collision in my game is completely messed up
it works 9/10 times
but sometimes they just go through eachother before correcting themselves
or sometimes they just keep going through eachother
even when I set my FixedTimeStep to 0.0005 it still happens
it does set IsOnGround properly and in time
but even though I do
if(IsOnGround)
{
rb.velocity = Vector2.zero;
}
it doesn't set the speed to zero
It does look like your falling code is still running and moving them despite them being grounded
I don't think you're supposed to change FixedTimeStep unless you have a very solid reason to
Ground checks should happen on Update
As it happens every frame
If you set to fixedupdate depending on your framerate it will be checked before/after the frame begins
so I got the problem
I now DO do this in FixedUpdate
which makes it work
I believe all physics checks, calculations and alterations should happen in FixedUpdate
If you're checking things like if the player is grounded it should happen every frame, or you'll have issues
FixedUpdate doesnt runs every frame, so if you have a high framerate it WILL cause problems
FixedUpdate is every frame, as far as the physics engine is considered
yeah u should do ground check in fixedupdate
If you do a physics check outside of FixedUpdate, it'll run into disagreements with the physics engine about where things are at the moment
The update functions are separate so physics will always run the same way regardless of high or low framerate
does a layermask in Physics2D.RayCast filter that layer or only detect that layer?
it detects only that layer
if it first hits another collider does it just go through that or does it return null
the RayCast
it'll ignore that collider if it's not the layer of the layermask
Which is really useful for making raycasts performant!
those two squares are supposed to only spawn above the ground
noit eachother
here they don't have a layermask
so they don't ignore eachother
and the ground has the layermask 8
but when I do
RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, Mathf.Infinity, 8);
it doesn't even detect the ground
even though it is of layer 8
The layerMask is not the number of the layer, it's a bitmask
what's that?
It's a way to represent multiple possible layer selections with just one value
then how do I select only the 8th?
To get the eighth layer, you'll have to define layerMask as
int layerMask = 1 << 8;
what if I would want 5 and 8
thanks!
This could be too old to work one to one
But I guess it's the | OR operation that does the trick
u could also show the layermask in the inspector and that gives a drop down menu
You can get layermasks by bitshifting, and from their name
playerLayer = LayerMask.GetMask("PlayerCollision") is what I did
Seems like 2D physics are having the Physics2d.OverlapXNonAlloc methods get deprecated sometime soon? Honestly seems kind of weird. Pops up in the documentation in documentation past Unity 2020.2
is there any poles in 2d ik? because my characters leg is bending the wrong way and im using a fabric solver
yes they are getting deprecated but they are being replaced by overloads of the normally named method
e.g. OverlapCircleNonAlloc is just being replaced by an overload of OverlapCircle that does no allocation
If you scroll down here you can see the non-allocating version: https://docs.unity3d.com/ScriptReference/Physics2D.OverlapCircle.html
Ah that's exactly what's happening. Thank you!
Kind of in this weird position right now where I'm looking to move a collider out of any colliders it might accidentally enter (e.g. the player closes a vertical door on themselves)
i don't have a problem dealing with that for a single collider, but I'm thinking of edge cases where the controller could end up in multiple solid colliders and wondering what would be a good way to find the closest valid location that's not inside of a solid object
gonna test out a few implementations, but if anyone has any input, I'd be glad to hear it tbh
When shooting projectiles, how do I aim the projectile toward the target place
Also how can I keep the projectile on its current course once it's reached the target destination
How do I shoot toward a target and keep the projectile going through that target point if it doesn't hit anything
basic vector arithmetic will get you there. If you subtract position vector A from position vector B:
B - A
the result will be a direction vector, which is the direction from A to B
then you just send the projectile in that direction.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
My issue is I have no firepoint
I tried creating one but wasn't sure how I'd fire from that point
before I go and write it myself, does Unity have actual decent support for Bezier/B-spline curves in-editor?
e.g. for setting pathing through the world
https://docs.unity3d.com/ScriptReference/Handles.DrawBezier.html well there is a way to display them in editor
Guess it's up to you to make things move along those paths though
aye, thanks for answering
shouldn't be difficult to implement, i'm just glad there's a display function already lmao
I'm struggling with my sprites (whom have rigid bodies and box colliders) crash into each other and get stuck to each other. I've tried adding a little force, pushing them apart upon contact, but it doesn't seem to do much.
var force = transform.position - target.GetComponent<>().transform.position;
force.Normalize ();
GetComponent<Rigidbody2D> ().AddForce (-force * magnitude);```
SS of effect for reference
Fixed it by adding a new material to my collider where I removed all friction
Hey so i'm not sure how to look up what i'm trying to do. i have a bunch of animations for things like dust and effects. but i'm not sure how to play the animation alongside the player action. do i just make a new game object make a child of the player and put an animator on that with a trigger or bool?
yeah so create a child called PlayerEffects or something like that and have an animator with all the clips
then u can use script to play the animations whenever u want if u make a reference to the animator using
animator.Play("clip name")
to make it easier to type out u can store the clip names in constants or structs
i usually use .Play() instead of the animator tree cus it seems easier
that seems like a logical step. i recently learned that i can set animation state to be a certain INT and trigger specific animations on the player like that. I've only been at this for a week or 2 so i'm still learning all the best use of application.
yeah i usually don't mess with the animation variables and transitions and states cus if u have lots of animations then the links can get messy
Is it safe to assume that the Awake() method of a script is called upon Instantiate() ? I am trying to instantiate an object, then call a couple methods on it immediately after. These methods use variables from the object, that get assigned in the Awake() method. I am getting nullpointers though π¦
one thing tho with using .Play is that before u play an animation u should check if it's already being played, u can achieve this by whenever u use Play store the animation in a string and check that against whatever u want to play later on
I have a problem with building my game. When I test it inside Unity everything works fine. But when I build it and than run it you can only see the Square and not the platforms. Thanks for help π
i think it is (called right after instantiate)
could u show ur scripts for the instantiated and the instantiater
it looks like u haven't saved ur 01 scene because there's * next to it in the inspector
could u save it and build again
@covert whale https://pastebin.com/tkkqqtTr <- script. Instantiation is done with
InfoSheet infosheet = Instantiate(infoSheet, transform.position, Quaternion.identity);
infoSheet.setHeader("Oak Tree");
infoSheet.setText("The tree currently has " + currentHealth + "/" + totalHealth + " health left");
}```
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what errors are u getting
what have u set infoSheet to be?
Well its still the same
is there anything in ur samplescene
Yea everything is there
and what's in ur 01 scene
How can I see thatπ
don't u have it open currently?
if u want to see what's in a scene then look for it in a folder and double click on it
at the top untick Scenes/SampleScene
because i'm pretty sure it's just empty so unity will load on it and there'll be nothing there
do u mean to have ur SampleScene to be the first scene that loads
@covert whale ffs .. thanks mr rubber duck! I was just being an idiot π I duplicated the variable name, essentially overriding the object I wanted to instantiate
@covert whale fixed now π And working
nice
Im not to sure
Well when im inside 01 and I test it, it works fine
ok so in the build window here under scenes in build
untick SampleScene
this means that when u start the game it will start on 01
Alright now it works thanks a lot π
hey, guys this is my script to choose a point random, form a list. But I dont wanna him to choose the same point twice, how can i do that?
either cache the last picked point and then rerandom if it's the same, or create a copy of that list, shuffle the copy, then go through that copy, removing elements from the copy as you use them. Once the copy is empty, refill it with the elements and reshuffle
Kian, you'd need to remember, somewhere, the point you previously jumped to. Make a loop - pick a point. If it's different, quit the loop. Now update the "last point".
You also need to have a 'last point' at the start - a simple thing to do is use a point that's not in the list
if you never want to use the same point, do what Wytea says
ah, good point. I didnt think about if they wanted to use the same point again, just not consecutively
up to you, Kian
ok guys, thank you so much π
I'm new to Unity, but an experienced programmer. I'm starting a more-than-game-jam-serious game with a friend. It's a farming game, basically, with land tiles. Something like this: https://i.pinimg.com/originals/5e/74/fc/5e74fc089d00dd3c6ef97f56afeb2c91.jpg
I'm wondering if just making them game objects and laying them out with code is a reasonable solution
or if that'll have terrible performance
If the tiles are purely meshes then it shouldn't be much of a performance issue. Depends on the scale though. >7k may start having issues. But you'll prob have polycount issues instead
If they're tiles, you don't really have a choice.
Yeah that should still perform well.
Ok, cool
to some extent I'm also wondering if the tilemap system is being maintained - I tried following tutorials and can't get the 2d extras to compile.
Where did you get them from?
the github repo
Did you follow the Tilemap section in the readme? Different Unity versions require specific branches
ooh, no, thanks
I take it I should clone with git into the Packages directory instead of using the palette manager tool
yeah put the branched repo in ../Packages/. I'm not sure what you mean by the palette manager though?
Hello guys, i'm trying to use OverlapBox for ground detection, and it works. The problem is that now i want to use DrawCube to see how big my OverlapBox is, but Gizmos isn't drawing.
I was using OvelapCircle and DrawSphere before and it worked, idk why DrawBox isn't.
what's ur groundcheck.position?
Right here.
If i use a DrawSphere it works, but i need a DrawBox since my collider detector is now a box.
maybe the z value is off?
It shouldn't be 0?
what's the z value of the player object
0 as well.
could it be that the camera doesn't render the gizmos cus of the z axis
does the player container have a z value that isn't 0
or the player object that the sprite renderer is on
what is this? I just downloaded and opened unity
All 0. But...
The Sprite do is on a different layer.
oh ok
could u set the z of horizontalboxcollider to be positive
just to see if it works
because i think if the z is 0 then the box won't have a thickness
It doesn't. I drag the player outside the background to see if the background layers was giving me troubles, but it doesn't seems to be the case.
I just put 1 on the z axis, tho.
it could be that the box is too small so maybe increase its size?
Maybe.
Didn't work.
I just don't know what to do as well.
At first i thought it was because my OverlapBox didn't have any angle, but it actually has nothing to do with my DrawCube. And the DrawCube function doesn't admit more arguments.
could u make an empty gameobject and a new script with just
void OnDrawGizmos()
{
Gizmos.DrawCube(transform.position, new Vector3(10,10,10));
}
just to try out if it works
Okay
Hmm, it works.
Even as a child of my player and with the Transform reseted, it works.
I guess im just gonna replace my groundCheck with this new object.
if it works it works
So if i turn off the script on the gameobject.
And instead i try to do the same thing on the same script as my character controller
Gizmos doesn't draw.
On the other hand if i try to draw it from my groundCheck script, it works just fine.
groundCheck is making reference to the game object i just created.
So, wouldn't it be just the same as if i write transform.position on the script attached to the object itself?
Anyone else ever encounter a sub-optimal rendering of tiles within tilemaps which live on the same layer? I thought that ordering the different tilemaps as seen in the screenshot would give one tilemap priority over the other. When starting up Unity there is a 50/50% chance it renders correctly or wrong, I can't find anything about this issue online though it would be a pain if I had to 'merge' the void blocks with the wall tiles because it's quite modular the way it's set up now. Any help would be greatly appreciated! (running 2020.3.12f1)
could u do a debug.log of groundcheck.position to be sure
Sure.
Ooh, i think i found something.
Here i'm trying to shortcut the Vector3 by adding a reference to the new Vector3. Just like how i have it set on my character script.
And nothing happens.
If i do it this way, it works.
i've looked at the script so many times how could i not see that
well at least u found out
Remember the DrawSpheres? Those are predefined, and it works. So i asume i need to define what is Vector3 before the Draw.
Now it's working.
nice
Success. Thank you!
have u changed the sorting layer in the tilemap renderer?
u can also change the order in layer
The dark 'void' block and the walls are rendered by a separate tilemap renderer, but on the same layer and same order to enable me to draw walls over void tiles and make the void tile draw over the side of the wall on the left. I'm essentially combining different tiles into a single one.
I can imagine the renderer being confused as to what order to render in as it results in a stalemate, hence the 50/50 chance of getting it correct/wrong
How do I sense the horizontal and vertical movement speed of an ai?
i think u'd have to change the order in layer or put it on a separate layer
otherwise the renderer doesn't know what to do
Possibly, though that would make this kind of modular tilemap impossible. Or I would have to bake the void part of a wall into the actual wall sprite itself.
As this would be the result of setting the blocks order in layer lower than the walls'
i think combining the sprites together would be best
I was afraid you were going to say that π
does anyone know how to sense the horizontal and vertical movement speed of an ai
Sorry, i haven't used AIs yet.
Does it utilize a rigidbody? If so, rigidbody.velocity returns a Vector3 that represents the velocity.
yes it does, thank you :)
Hello, I am using https://docs.unity3d.com/Manual/class-HingeJoint2D.html and trying to rotate sword(gameObject HingeJoint2D is on) via scripting. But I couldnt get smooth rotating like how the rotation when I turn on Use Motor. I want to get same rotating behavior but with just scripting. Here is my code, I just want to rotate but sword changes position relative to connected-rigid-body. How can I achieve this?
void FixedUpdate()
{
Vector2 anchor = swordJoint.anchor;
Rigidbody2D attachedRigidbody = swordJoint.attachedRigidbody;
Vector3 position = attachedRigidbody.transform.position;
position.x += anchor.x;
position.y += anchor.y;
attachedRigidbody.gameObject.transform.RotateAround(position, zAxis, horizontalSword * Time.fixedDeltaTime);
}
Just noticed, rotation works great until the sword hits some collider. Then it starts to move away from the player, but I want it to move with player. When I do the rotation with motor sword lifts the player instead of moving away.
the problem with motor, it ignores gravity. So I tried to rotate with scripting but now it behaves different on collision.
Btw I am trying to write the mechanic from this game just for learning purposes: https://cosmicadventuresquad.itch.io/deepest-sword
I figured out how they did it. They are enabling/disabling the Use Motor boolean field. But this way gravity does not work when player is rotating the sword. Is it impossible to achieve?
I have another question. Should i be calling this on the LateUpdate?
Good morning π I have a UI element, consisting of mostly Text and Button objects. The element is enabled and disabled (SetActive) whenever I click on something. I have also put a draggable script on it, so I can move it around. However, once I set it active, I can interact with it a few times, then it seems to "freeze", and stops responding. Any ideas what that might be?
u should be calling input checks in update as to not miss any inputs but u should call any physics interactions in fixedupdate so to keep the physics consistent no matter the framerate
lateupdate is for if u want to do something in update but it relies on variables or methods set in another script's update, so u do that something in lateupdate instead
i would keep wannainput and wannaanimate in update and move checkcollision, climb and crouch to fixedupdate
could u show ur script and screenshot ur canvas hierarchy?
hello, I'm getting confused in the transforms of Unity. Here in My picture, the snowman object should be on top of the box because I set the transform of it the same with the box. But I don't know why it has an offset?
[SerializeField]private GameObject[] spawnPoints;
Vector3 newPos = new Vector3(spawnPoints[i].transform.position.x,
spawnPoints[i].transform.position.y + 3.0f,
spawnPoints[i].transform.position.z);
//instantiate then add directly to the list
snowmanList.Add(GameObject.Instantiate(snowMan, newPos, Quaternion.identity));```
I'm really confused on why is there an offset on the position of my snowman
u've added 3 to the snowman's y position
ahh yes, because I still want the snowman to be seen in the world that's why I offset it in the Y axis. I'm just worried on the x and z axis.
can u show the hieararchy of the snowman object
Well it is only spawn by the script. The script is placed inside the spawnPoint object
yeah so can u play the game then click on the snowman object to see what its position is
in the hiearchy
I have a debug for it, and it is constantly showing the right positions of the boxes(spawnPoints): -5,-5, 5,5, ..
yeah i saw that
but i want to know if the snowman object has any children
because it could be that those are offset
The snowman object has 3 children in it, 3 sphere objects
are those offset
yeah so their x and y isn't 0
but those are linked to a parent?
yea
the transform that children show aren't the global position but the local position
the global position is the local position of the child + the transform of any parents they have
ohh, I thought object that come from prefab will have its new pos going back to 0,0,0
for example if u set the position of Snowman to be 1,1,1
the position of SnowmanBody1 would be 2.4, -1.6, 0.5
because that's its local position added to its parents position
but it will still include the child pos
but is there a script for me to check the prefabs children and access its positions?
yeah u can reference a gameobject's first child with
gameobject.transform.GetChild(0)
then to get the local position of that u could do transform.localposition
u could also just change the positions of the prefab to be centred on the parents object
like in the editor
next time tho if it's not 2d could u post in one of the other channels
cus this is #πΌοΈβ2d-tools
ohh noo, so sorry. I thought I clicked the general code
it's alright
Help. After Loading the Scene on the Restart Button it spawns houndreds of enemies
show the code. otherwise no one can help
u've done it in Update which is called every frame
if u want to do it once at the start then do it in Start()
at the top u've defined i as
public int i = 0;
yes but it still spawns 6 enemies every 2 seconds. But after i click the restart button it doesnt
This is the normal game
But if i reload the scene on the restart button there is such an big amount of enemies
restart button?
Time.time is the time since you started running the game
sry
I think you want Time.timeSinceLevelLoad
omg pls not
you're better off declaring a float as a timer and increasing it by time.deltatime.
if you have a restart button, it doesnt reset time.time to 0
I want to spawn the 6 enemies every 2 seconds
We understand
i thougt imma do that with time.time
I just told you the problem with that
it dosn't reset when you reload
just switch to timeSinceLevelLoad
staff please, i need my friend unbanned HarryDevv#0001 his account was hacked and sent messages to people and all discords. please send me a DM we need to talk.
oh yeah sorry. I need to go. Will try it later
But still thanks for your help
not the channel for this. if you want, you can try to DM one of the community moderators
so weird that out of all the channels you picked this one
#πΌοΈβ2d-tools is warm and inviting
@covert whale the script is very simple
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Draggable : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
[SerializeField]
private bool dragging;
[SerializeField]
private Vector2 offset;
public void Update()
{
if (dragging)
{
transform.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y) - offset;
}
}
public void OnPointerDown(PointerEventData eventData)
{
dragging = true;
offset = eventData.position - new Vector2(transform.position.x, transform.position.y);
}
public void OnPointerUp(PointerEventData eventData)
{
dragging = false;
}
}
This is the hierarchy
It's the LumberjackMenu that's giving me problems. It activates fine .. works for a bit, then stops working.
@covert whale here's an example of the problem occurring: https://www.youtube.com/watch?v=yvcg-IsppGc
what about the setactive script
how do I make my character get knocked back (after being hit by an enemy)
Im trying to make a damage over time function made by Dapper Dino, but whenever run it crashes
{
if (burnTickTimers.Count <= 0)
{
burnTickTimers.Add(ticks);
StartCoroutine(Burn(_colliderHealth));
}
else
{
burnTickTimers.Add(ticks);
}
}
IEnumerator Burn(Health health)
{
while (burnTickTimers.Count > 0)
{
for (int i = 0; i < burnTickTimers.Count; i++)
{
burnTickTimers[i]--;
}
}
health.Damage(10);
burnTickTimers.RemoveAll(i => i == 0);
yield return new WaitForSeconds(0.75f);
}
Does anyone know how to fix it?
it looks like the while statement will run forever because you never remove from burnTickTimers in it @wintry stone
Woudnt burnticktimers get removed by this line burnTickTimers.RemoveAll(i => i == 0);
Also this coroutine only has a yield at the very end of it. WHy does it need to be a coroutine at all?
that line is outside the while loop
it can't run if the loop never ends
Ah I understand thanks!
OMG IT WORKS thanks
Why doesnt this work?
lastScore.text =
omgπ€¦ββοΈ thanks...
How do i render my text(top right) over the rockets?
is the text a UI element?
and are the rockets sprites or ui
sprites
do u have ur text in a canvas
yes
could u screenshot ur hierarchy
check if the canvas is on the layer ui
cus if it's not then it won't always render ontop of everything else as it should
The rocket is on default layer and the text is on ui layer
i don't know how a text object that's in a canvas could render below a sprite, unless the canvas was in worldspace
it isnt
what mode is it in
Show your hierarchy where we can see the rockets and the text
I am tasked to make a rope spawn between 2 objects with tiling .
- objects appear in random coordinates
2)on 1st click nothing happens, on 2nd click the rope starts appearing (there's supposed to be an animation )
I am not sure how to do this with a script, you guys got any ideas π ?
Enemy1 is the rocket
and heres the text
what mode is the canvas in
Show inspector of canvas
oh it's in camera screen space
try changing that to overlay
or change the sorting layer
where do i change the sorting layer and to what should i change it
in the canvas component u can see 'sorting layer'
if u click on it there should be a drop down menu and u could add a sorting layer
i tried but if i put it on the new layer i cant see some parts of the game
wdym
Cant see floor player and enemies
is that cus the ui blocks them or what
idk
could u show what u mean?
i think ur background may be covering them
try using a separate canvas that's on the default sorting layer or use a non-ui element instead
okay
having a tough time setting up a collider trigger (sounds like beginner code, I know). setting isTrigger = true does not prevent other objects from colliding with it, as the docs suggest. the only way I am able to have objects (i.e. the player) pass through the trigger is to completely disable the collider. with the collider disabled, OnTriggerEnter2D is not sent when objects pass through it. I think some of these problems might stem from the fact that the player uses both colliders and raycasters (this is not my game, I am modding a game). One final point: the unity-explorer does not see the OnTriggerEnter2D method at all in the component I have added to the object (code for this below, in case I made some simple mistake):
public class LaserHurtbox : MonoBehaviour
{
public void OnTriggerEnter2D(Collider2D other)
{
UnityEngine.Debug.Log("Laser Triggered");
}
}
any help / ideas for debugging would be greatly appreciated, I'm a bit ashamed to admit that I've been stuck for a while on this
sorry what's the issue
What is the real issue here? OnTriggerEnter2D is not being called?
is it that it doesn't print
also i think ontriggerenter can't be public
i think it's private
sorry I guess I didn't explain it well enough. the issue is two-fold: objects still physically collide even when isTrigger = true (the docs suggest that objects should pass through triggers once this is set) - the only way I'm able to get objects to pass through the trigger is by completely disabling the collider, in which case the method is not called
alright cool - I had it private originally and wondered if that was part of the issue, I'll change it back to start
Well, if thereβs no collider of course the message wonβt get called, thatβs a given. The real odd part is collisions still happening with triggers
yep - like I said I think its because the player object uses both colliders and raycasters for collisions
Can you show the inspector of the objects involved?
sure thing, one sec - anything specific you need to see?
Iβm not sure yet to be honest
It might help to move this to #βοΈβphysics if you canβt get help here anytime soon
if u want the collider to be ignored by raycasts u can put it on the ignore raycast layer or set a layermask
oh this is immediately helpful - I wasn't able to find much on how to do this other than globally changing raycasters to not interact with triggers
heres the player objects (lots of components I know)
and the object I want to act as a trigger
the code for the trailrendererwith2dcollider is here, though I'm definitely not asking anyone to read through it: http://wiki.unity3d.com/index.php/TrailRendererWith2DCollider
so does it work when u set the layer to be ignore raycasts?
sorry I'm usually a back-end dev, not entirely sure where to change this - could you point me in the right direction?
thank so much for both of your help so far by the way
so in the inspector where u see Layer: Default
ah, of course
click on the default and u can see a drop down menu and ignore raycasts should be there
unfortunately, no change
ok so do u know where the code is that does the raycast
sort of - theres at least 4 different raycast components for the player and at least 2 colliders
I think this is beyond my knowledge, but you look like youβre being helped already
i'd go to each raycast and see if there's already a layermask used and if so then make sure it doesn't include the ignore raycast layer
Hello. Why doesnt my Post Processing work?
turn on Is Global
and then try putting this main camera in the post processing layer, if it isnt
but that whole layer thing is for volume blending
dont you mean putting the processing layer into the main cam?
I dont even know what that means
you dont put layers into things, you put things into layers
alright so I checked all of the raycasters and colliders, none in the ignore raycast layer - but in the process I was able to try something that maybe hints at a deeper problem (?) I completely disabled the player's raycasters (and left the colliders active) and moved the player through the trigger and still the OnTriggerEnter method was not called - so now I'm extra confused lol
also does it help or hurt to add that the thing collides with itself for some reason?
if i'm being honest i think that maybe ur trailrenderer is buggy
i'd try to do it using the normal unity collider
yah, I've been thinking it might be that - I think the code is several years old so perhaps a unity update broke it
have u used it on anything else?
I do really appreciate your help though - I'll see what I can do with just plain collider2D
nope, nothing else
(and unsurprisingly, everything else works)
yeah so no way to know if it works nowadays
oh wait if it's an old unity thing that relies on physics
i think there's a setting that maybe useful
ooh do tell
if u go to edit > project settings > physics 2d and enable auto sync transforms
i think that's a setting that used to be on by default in previous versions of unity but is turned off in recent ones
ah, in the unity editor? I only have access to the raw assembly of this game lol
oh
yah that makes everything about 100x harder haha
thanks again!
does anyone know any good tutorial video to learn how to create a finite state machine(class based not using enum and switch) for a 2d platfomer.
Pls let me know if you do
can see object in editor but not in game?
I donβt know if itβs good because itβs the only one i ever followed
I am kinda scared about my Game. If i play it on an other Screen size it looks completly false
This is how it looks like on Free Aspect
But this on Full HD
check the z values of ur camera and the object
the object should have a larger z value than the camera in order for it to be in front of the camera
https://youtu.be/78PLsHnRXiE
this is the tutorial i used to make my one, i found it really helpful
don't worry about it being part 20 he starts from the beginning
sorry this one is where he starts the state machine
https://www.youtube.com/watch?v=OjreMoAG9Ec
your y scale doesn't match the x scale meaning it's stretched on one axis but not the other
every frame. It's all in here: https://docs.unity3d.com/Manual/ExecutionOrder.html
could u show the script
thank you !!!
what about where you define Mana
my menu runs at 2000fps but when I go past the objects quickly with my mouse they don't respond at all
set getmana to be public
so public void
it's alright everyone does stuff like that
lol
@covert whale sorry mate, I had to pop out for a bit there! The script looks like this, https://pastebin.com/929LMBXf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
after u get the buttons to freeze could u click on them in the inspector and see if interactable is checked on the button component
Looks good
All buttons are set to interactable
could it be that a raycast box ( ? ) isn't being moved? It seems the box remains responsive as long as I don't move .. or if I just move it within a very limited area..
i don't think so
i'm not sure what the problem is
i made a button myself that disables and enables another button and even if i spam it multiple times the other button still works
It's really weird π€·ββοΈ But it definitely seems like the component keeps operating as long as I keep it in a very focused area. If I move its position, it will freeze
u could do rectTransform.ForceUpdateRectTransforms
just to see if that changes anything
Um, well, I just moved the component down the list (to the bottom of elements on the canvas), and now it seems to be working perfectly
Really happy it's working - no clue how! haha
Not sure if that's a good thing or not
if it works it works
I get that at work quite often. "Why did you do it like this?", "I dunno! It just worked, then I left it alone"
how do I change the sprite a particle system emits in code?
my guess would be to somehow access the particleSystem component's renderer
I don't see that property in the docs though
Hello, I would ask about how to do one thing. I would like to do destructible wall like in Tanks 1990 game and I don't know how to achieve that. I came across sprite mask which means I would need to create new object every time I shoot a wall. My second thought was to slice a sprite to 4x4 pixels, combine it into one game object and call Destroy on collision. What would be the best way to achieve such destruction?
Hey, I make a 2D game, but i do the code and my player don't move, if someone want i can send my code
@balmy willow If you are asking a question post the code and highlight the problem in detail.
I cant send
@balmy willow How to ask question and post code is in #854851968446365696
Can i send by a text block ?
It's ok ?
So what's the question?
why my player don't walk ?
Its a 2D game
if you want to see what i put in the script on Unity
I search in the code but i see nothing
@balmy willow do the float horizontalMovement change while ingame?
i think
where can i see ?
you have to create a new public variable and set horizontalMovement to it
so u will see in the inspector
so
if the float isn't the problem
problem here
Vector3 targetVelocity = new Vector2(_horizontalMovement, rb.velocity.y);
vector3 = vector2
logic
x)
I change the code
i take that in the code ?
replace it by Vector2 targetVelocity = new Vector2(_horizontalMovement, rb.velocity.y);
what i change ?
so i put Rigibod2D
so in the code on the top replace rigidvody by rigidbody2D
and
the vector3 at the bottom by vector2
wait
wtf
I already have Rigibody 2D
wait
or replace every Rigidbody2D or Vector2 by Rigidbody or Vector3
to make everything 3D
but it will keep the game 2D np
ok i test
ok post the error if there is
and the inspector pls?
put the rigidbody2D in the case "rb"
or change everything to 3D if it didn't work (rigidbody2D = rigidbody ; box collider 2D = box collider etc...)
and put the rigidbody in rb
?
if you making 2d game, just stay in 2d
so i need to restart
ye but actually it fack everything
idk how to do smooth damp in 2D
but then whole level has to be done in 2D and 3D. platforms etc
set up your visual studio properly first for error highlighting and autocomplete/code suggestion. #854851968446365696
Go on 17
i just can jump
You should do everything you did , but stay in 2D for vectors and rigidbody...
ok i test
make sure all your vectors, rigidboirs, colliders are all in 2D. you cant mix them with 3d
restart the simulation
yes
not complicate
but actually keep it
yeah ?
mixed vectors
can we see your variables
that ?
how ?
ok
so what can i do ?
paste your whole code again
wait i do an upgrade
a powerful website for storing and sharing text and code snippets. completely free and open source.
it's ok ?
if ur in fixed update try time.fixeddeltatime instead of time.deltatime
ok i change
if u've configured ur vs properly then it should've autocompleted with the right spelling
i configured
d and t are capitalised
But wait i retest
ok
could u screenshot some code just to see
what ?
just to see if it's configured
some code of what ?
some code of ur script
like this
yeah it's not configured cus it's not the right colours
oh ok
if it was configured Vector2 for example would be green
have u followed the steps in #854851968446365696
you have an underscore _horizontalMovement. is that supposed to be there?
it's their parameter name
If your IDE was fully configured it would autocomplete that and you would not make basic capitalisation mistakes
I use VS because code had extra steps to configure for intellisense
https://code.visualstudio.com/docs/other/unity
have u followed through the steps on this
yep
You could fix the delta time capitalisation, or undo it...
i need to restart i thinl
restarting would be good
smoke...use Visual Studio if you can
i think these errors should be underlined in red in ur vs
go to ur code and check those lines
i don t understand, i install all of these extension but no
if vs code doesn't work for u then u could try vs
use full fat visual studio
it s ok
i find the error
i find why i have all of these error
i just need to go im sorry
thanks at all
bye
No nothing changes. The Camera just zoomes out more.
wait what's the issue
That i see parts of the scene on full hd
i'm not sure but u could set ur canvas to scale with screen size?
and check if ur background image is stretched
Yeah i could but i want it to fit to every screen size
wait i can send you pics of the problem
This is how my game should look like
But if i change the game view to full hd it looks like this
so basically everything zooms out
ok so what i'd do is set the resolution to be 16:9 and adjust ur game to that
then set the canvas scaler to scale with screen size and put a 1600:900 resolution as reference
okay i did the first step but where can i find this canvas scaler
it's a component on ur canvas object
this one in red here
okay thanks
than i will try that out
yes okay thanks it works now fine
also on 4k
thats cool
Hello. what code do i need if i have 2 toggles and only one can be true at the time
I would like to make a game where I play as a kangaroo escaping from the villain.
Please answer me.
if u want to know how to make a game then look for a tutorial there are plenty of them out there
if u have a specific question relating to how to code then come back here
I don't know how to code the game.
that's not a very specific question
Out of the topic question, how can i change scenes after i logged in? PHP backend
bool bool1;
bool bool2;
if(bool1 && bool2)
{
//set one of the bools to be false here
}
you can do this
bool wasPressed = false;
if(!wasPressed)
{
wasPressed = true;
//anything here
}
else
{
wasPressed= false;
//anything here
}
this another way to do it but with slightly different use case
bool wasPressed = false;
bool wasPressedTwo = true;
wasPressed = !wasPressedTwo;
and this another funky way of doing it <- Do this only if you want to show off in front of your girlfriend!
bool wasPressed = false;
wasPressed ^= true;
welcome to my c# class π
hehe
the last one, is widely known as XOR operator, just in case you're wondering π
why doesnt this work?
what does misread mean?
sry my english not the best
i'm not sure i haven't used toggles or togglegroups
okay
you need to attach a toggle group component to a game object then set the Group value on each of your toggles to the game object that has the toggle group component. That makes it so that only one toggle in the group can be selected at a time
quick example of that would be this. the Toggle Group component is attached to the canvas here so i set the group for each toggle to be the canvas so only one can be selected
okay thanks
Why cant i drag the player object in there?
Is it becaue player is in another scene?
yeah can't drag something from another scene into an inspector field, has to be same scene. You can reference the player game object another way though. this video gives a few ways to reference gameobjects
https://www.youtube.com/watch?v=ymq2AUckws0
Check out the Course: https://bit.ly/3i7lLtH
Learn 5 different ways you can connect your gameobjects in Unity. Ranging from direct references & singletons to scriptableobjects and injection.
More Info: https://unity3d.college - (and where you can submit your own questions)
Join the group: http://unity3d.group
thanks
doesnt work for me
Anyways. I exported it now and you can play it
how can i make this for funcional?
what are u trying to acheive?
Im trying to make a dialog system, and I wanted the image, name and sentences shows up when i is equal a number of the arrays (sorry for my english)
are all the arrays the same length?
so u don't need the &&
just do
for (int i = 0; i <= dialogue.Sentences.Length; i++)
{
}
i got the same error : Object reference not set to an instance of an object
could u show ur whole script and what line does it point to?
it's cus u haven't set what the Queues are
u've only set sentences to be a new queue but not names and images
oooohhh thank you, thank you !
Hello everyone I just downloaded Unity, I have a good experience with coding so I think it's about time I use Unity. I was wondering which tutorial series on youtube would be the best to learn how to make a 2d game with Unity
Probably Brackeys's. It's a good introduction.
anyone got some 2d movement code
no one is just going to give you code here lol
no, you're just not going to get free code like that.
you're better off just googling
if you don't know how to code it yourself, you should check out some tutorials. Brackeys on youtube is suggested a lot and has some good tutorials, there are also some great (and free) courses on udemy for 2d games. don't rely on random people to just give you code for free
you won't learn anything by copying
Hello guys/gals so i'm working on a script that will redirect me to another scene in Unity 2D, all the tutorials i've watched so far are obsolete codes, so here i am.
here is my code:
on a script that will redirect the user if the credentials he/she inputs are correct*
Guys, need help pls! I want to separate my view content from my data content, so i have data prefab which refer view prefab through Addressables. But it is a little bit uncomfortable to set data without seeing view. What i want is to fake sprite rendering of refered prefab to my data prefab. My first try was to draw texture on gizmo when gameobject is selected and load asset by addressables guid. Loading works well, but i can't find proper way to render sprite in scene view (drawing texture through gizmo gives strange result, when texture snapping to int screen coordinates). Anyone knows how to do it right and is it possible?
https://docs.unity3d.com/ScriptReference/GameObject.AddComponent.html
make sure you are attempting to add the component correct
player = GameObject.FindWithTag("player") as GameObject; like this?
if the issue is the player gameobject, then make it not static
also i'm pretty sure you don't need to check if the player object is null at the start, just assign the value in start instead of checking if it is null
but i cant drag the gameobject from the other scene into this
so i am doing this static
i just cant find a solution to get my object player from one to the other scene
make it a prefab and just instantiate a clone. you can save any stats that change into a scriptable object or save it in another persistent class. or you can call don't destroy on load so it doesn't get removed when you switch scenes. You can't find an object that isn't in an active scene using the gameobject.find methods
what is a prefab
you may want to check out some basic Unity tutorials to better understand how to utilize the editor to its fullest
and if i drag the prefab now into my main scene and give him another Script there, will he still have this script in the next scene?
only if you are passing that game object into the next scene rather than just making a new copy of the prefab.
Hey guys im making a platformer game and im having a problem. My player sprite turns small while in animation. can anyone help me
Help me please
:((
Remove any scaling from your animation then?
Hmm
I think the problem is maybe the sprite
The actual problem is that your gameobject is not 1,1,1 scale.
And your animation is expecting it to be, and you have a scale property in the animation that is adjusting the scale.
So how to fix it?
Either adjust your animations so the scale properties they're animating are in line with the scale of your gameobject.
Or vice versa, making the gameobject scale work with the animation.
Guys on the edge of box colliders, circle colliders act different than the physics2d.CircleCast
Im using physics2d.circlecast in order to find the trajectory prediction of the circle
However as I said if thats the edge of the box collider this prediction and the real movement may produce different results
What can I do to predict more accurately?
How would I get a 2d map like google maps in unity that can have locations and stuff marked on it? But not google maps because the API costs money
Whatβs the difference between 2D and Mobile 2D
In what context?
Templates?
Mobile 2D template starts with Android Logcat and Mobile Notifications packages installed
and apparently some project settings already configured for mobile platforms
hello i need some help with the collision on unity2D i have a test where the player is a white cube and there a ground but i want to know how to make the player and the ground collide. also i want the player to have gravity but not the ground
you have to add colliders to both and then i forgot. maybe rigidbody and checking the collisions iirc
The ground should be Kinematic
That βοΈ makes it a static object which won't move
thanks
it work
you're welcome ^^
not sure if that was 100% how it worked but give it a try π
perfect
Like say you wanted to make a mobile game couldnβt you export to phone using 2D instead of mobile 2D?
is it possible to know how much time this take?
set your own timer?
but the time that takes its different to phrase to phrase
yes
because I have 2 text
one for the name of who is talking and other to the dialogue
and sometimes, the first name already disaparead and the dialogue isnt complete
thats sounds like you're not toggling something correctly rather than a timing issue
hummmmm gonna check O.o
Hi I'm having trouble understanding the rule title system. I understand it's a way to make custom and easy to use brushes for painting tiles in a scene that automates the process of adding certain tiles.
But the rules system just doesn't make sense to me. I don't understand what the main sprite represents and how the additional "rule" sprites correspond to the red and green arrows or blanks.
Everytime I watch a tutorial or read the documentation my mind just gets stuck and I don't know if I'm just dumb or if it's really that complicated... I can't wrap my head around the concept.

Most everyone is asleep right now I imagine, and though you said you've been watching tutorials I must ask. Did you check brackeys?
Who?
I can wait till the morning. But please reply to me if it's been a while after my response so that I can get notified. Or ping me I don't mind
I'm not sure he has one that directly applies though he does have a video covering tilesets.
https://www.youtube.com/watch?v=ryISV_nH8qw&t=29s
If not that then maybe: https://www.youtube.com/watch?v=dd4KrKCa3Yg
Learn how to use the Tilemap tools in Unity to easily create cool 2D levels.
Watch TILESET in Photoshop: https://youtu.be/aaEEujLtsr8
β Download Tileset: http://downloads.brackeys.com/tutorials/TilesetExample.psd
β Extra Features: https://github.com/Unity-Technologies/2d-extras
β Extra Examples: https://github.com/Unity-Technologies/2d-techde...
An in-depth but easy to follow tutorial on how to set up and use the rule tile in your game, starting with an empty project.
My music channel: https://bit.ly/3dFq3Hf
Artist who made the tilemap (Eli): https://bit.ly/376cmyM
#Unity #tutorial #rule_tile
I was watching that
Essentially the arrows define, whether they should merge with a tile on that side.
But I still couldn't understand. Maybe I'm sleepy or there's something wrong with me
Green means it should merge, red means it should stand alone that the edges should not connect.
If the tile should connect with the one on it's left, place a green arrow on the left of the 3x3 grid.
inside of the arrow
Technically
If you're seeing the gray center as the current tile.
The gray circle or sensor represents the current rule tile and not the default Sprite?
The default sprite should be to the right of the 3x3 grid
Hopefully you've already sliced your tilemap correctly in which you'd be ready for that part.
But there's a default sprite at the top and then the tiling rules have their own sprites
the default sprite is just what is shown in the tile palette
The tiling rules are the ones you've sliced. The default tile.. ^
Which you could just set to a center piece with four edges if that helps
?... The sprites I'm pulling are from my tiles which are all sprites that I've spliced
Ok...
I'm sorry.. it still doesn't make sense to me...
Red light green light
Red light means no touchy, the edges do not connect and become a different type of sprite.
The green light means touchy, the edges connect and change the two sprites to be connected.
To "appear connected"
Hm
For now I recommend some sleep, atleast for me personally. Perhaps with a fresh mind it'll click.
I was just about to say that
If I can, I'll think of a better metaphor
Thanks. It helps me understand if I think of it as a person. Maybe I don't understand the actual objective of this tool..
Badduck has a good visual for it
https://www.youtube.com/watch?v=dd4KrKCa3Yg highly recommend
An in-depth but easy to follow tutorial on how to set up and use the rule tile in your game, starting with an empty project.
My music channel: https://bit.ly/3dFq3Hf
Artist who made the tilemap (Eli): https://bit.ly/376cmyM
#Unity #tutorial #rule_tile
its just to make painting tilesets easier
I'll watch it again.
so you don't have to manually place tiles yourself
Aye
so you can say, "hey, I want this area to have a bunch of tiles", and unity will figure out which tiles go where based on your ruleset
Right
You define the rules now, so you can paint freely later.
Like Mario maker except I'll be in control of now they merge
Never tried, but I think so yes
Ohhh so I don't need to add a default sprite
Correct
You may leave it empty, it only serves as a visual FOR YOU alone, in the editor.
What do you mean a visual? Oh like it's not actually a placed sprite. It's more like a cursor
That makes so much more sense...
So I should make it something generic and looks obvious not like a sprite I'd use for the final product
Personally, I would use the center piece that is placed when there are no neighbouring sprites
As for what you should do, I guess that's up to you.
Some leave it blank entirely.
I understand now
woot woot
Thank you wizard of oz...
cool cool : )
How do i move my camera in 2D on the editor screen?
