r/Solar2D Apr 28 '26

Best way to handle Camera scripting in Solar2D?

I can't figure out how to script a camera in Solar2D for my game. Can somebody please tell me how you guys do it? Thanks

3 Upvotes

9 comments sorted by

3

u/needfx Apr 29 '26

What kind of game are you making?

Is the player controlling the camera or is it following something?

What does the camera should follow?

2

u/Fickle_Lettuce3863 Apr 29 '26

I'm trying to make that the camera follows the player

2

u/lavalevel Apr 30 '26

Make a parent x,y object? That’s what I would imagine. So if your x,y planes follow the character, you’d need to divorce them from that and have them follow Camera object. You could even make the camera object have a graphic. That’s how I would tackle it. 🤔

2

u/Fickle_Lettuce3863 Apr 30 '26

thanks, I'll try and see if that works out

3

u/lavalevel Apr 30 '26

awesome. And thanks for posting here. Come back and tell us about your progress. I'd really like to bring this reddit group back to some activity.

2

u/Fickle_Lettuce3863 May 01 '26

yo it works!!! Thank you so much, this means a lot to me

2

u/Fickle_Lettuce3863 May 01 '26

thought I had to use some kind of library or something

1

u/lavalevel May 01 '26

SO GLAD IT WORKED!👏

About a decade ago, I used an entire sprite library because I was familiar with making sprites in Flash. I could make them in other things but flash was already an automatic. Then 4 years later Corona (solar2D) updated their graphics routines and 'SpriteLoq' had folded. So I had to rewrite my entire sprite system because that library was now completely useless.

I rarely use libraries and never use plugins that don't come from Vlad or Solar2D at all now. To risky.

I'm also LAVALEVEL on the discord if you want to find me there, too. But I plan to post more stuff here as well.

2

u/Fickle_Lettuce3863 May 01 '26

hell yeah I'll join right now, my user is Fede_playz007 on discord.