New to AC, so I may have missed a setting.
2d game, std point and click movement. There seems to be some radius/buffer around my player within which clicks to path find are ignored. I'd like to be able to click even 1-2 pixels away from the foot position and have the character move.
Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, (The?) @GeorgeBroussard.
You're quite right - characters will rely on the Settings Manager's Destination accuracy slider (under the "Movement settings" panel) to determine "how close is close enough". Raising this slider will reduce the buffer.
If you're looking to be pixel-perfect, also know that the Retro-style movement? option in a character's Inspector, which makes a few tweaks to behaviour that suit pixel games.
More details on these topics can be found in the Manual's "Retro movement" and "Precision movement" chapters.
@ChrisIceBox, thanks for the tips. And yes to your question. Hi
Turns out I had Destination Accuracy set to 1 and it's ok but it puts the click about a body width away. Would be nice if it was a pixel or something.
Using Retro Movement and Only Move If Sprite Changes. Thing is though, upon stopping, the character isn't snapping to a pixel position. You can fiddle with the player object's position to get it there.
Is there a way to snap the player position to a pixel grid (assume 320x180 or something). Played with adding Unity's Pixel Perfect Camera on the Main Camera but it wasn't working.
Final thing (sorry for the Q's!)...on a scaling sorting map...the character scales, but again not to a pixel grid (render target etc). So you end up with a character scaled to a different sized pixel grid (I guess assume 320x180 art but running at 1920x1080).
Any easy fixes or missed settings for the above?
I know this is nit picky stuff. Just a stickler for pixel perfect
It shouldn't be so distant. How does your character sprite's scale compare with that of e.g. the 2D Demo player's?
Try dropping in Brain's sprite from /Assets/AdventureCreator/2D Demo/Graphics/Sprites/Brain/BrainIdle and put him next to your own. If yours is much smaller (which would be the case by default with pixel art), you're likely going to want to scale him up to something comparable. AC's default values are based around a scaling factor similar to this, so having him be similar will help make the default behaviour behave as intended.
When changing scale, don't do it with the Transform component - instead, just lower the sprite's Pixels Per Unit setting in the sprite asset's Inspector. That'll make them larger in the scene without affecting scale. If your character has a collider though, that'll also need to be resized.
A Pixel Perfect Camera on AC's MainCamera should do it, as that's the only camera that handles rendering.
Though, the Pixel Perfect Camera can take a bit of tweaking to get just right. You'll need to have its Assets Pixels Per Unit value match that of your sprites - so this'll need changing as well if you have to update those on your sprites. Checking Pixel Snapping should then cause the snapping effect.
If necessary, a character sprite's scale can be affected in a LateUpdate custom script function to round it up/down to an intended value, but it should be the Pixel Perfect Camera can handle this as well. IIRC, the Upscale Render Texture option should snap the final render to the Reference Resolution, so you shouldn't get any "pixel creep" with that checked.
This is only speaking generally, however. You're welcome to PM me your project files if you'd like more specific help.
FYI (and for anyone else):
Solved the issues with:
Dropped sprite PPU from 100 to 1 and that solved the click distance issues. It's weird that the 2D demo Brain character was also 100. /shrug
Pixel Perfect Camera worked fine - after I found an issue. For some reason, I'd set the aspect ratio AC Game Editor Settings to 1.7777 (16:9) vs Not Enforced.
Glad to hear it's been resolved - thanks for the details.
If I'm understanding your setup correctly: how large a sprite will appear on-screen is a factor of both the PPU setting as well as the sprite assets' dimensions. A character that uses pixel art will typically be a lot smaller that Brain - who doesn't - in terms of pixel size, so they'll similarly need a lower PPU value to appear the same size in-game.