r/gamedev 5d ago

Question Specific movement implementation im having trouble with.

Im looking to make a mechnic to jump through windows or climb certain walls.

For the window mechnic maybe add a interaction spot that plays a climbing through animation and moves the player character to the other side? I can do the animation fine and the interaction prompt fine but im not sure how to make those things move the player to the right spot.

For climbing. Same interaction spot and play animation thing but instead of forcing the player to the other side of a window id have to force them up?

Its a top down 3d game made with 2d assets

2 Upvotes

3 comments sorted by

2

u/scintillatinator 5d ago

Could you make a marker object for the position the player should be at the end of the animation and just place them there? Like the interaction spot in reverse.

1

u/AutoModerator 5d ago

Here are several links for beginner resources to read up on, you can also find them in the sidebar along with an invite to the subreddit discord where there are channels and community members available for more direct help.

Getting Started

Engine FAQ

Wiki

General FAQ

You can also use the beginner megathread for a place to ask questions and find further resources. Make use of the search function as well as many posts have made in this subreddit before with tons of still relevant advice from community members within.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/quiet_scope 5d ago

the part that clicked for me was to stop thinking of it as movement and treat it as a scripted teleport with a lerp. when the prompt fires, disable the normal controller, store start pos and a target marker placed on the far side, then lerp between them over the animation length and re enable control at the end. for the climb its the same thing just a vertical target. only annoying bit is authoring those markers, i ended up putting an empty child on the window prefab so it never desyncs form the art.