This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

The problem is the godot thinks that the player is near a wall when the player isn't near the wall. I'm trying to get this to work for wall jumping like super meat boy. Here's the code

(This is a comment) Possibly could have to do with the function updatewall_direction

var movedirection = -int(Input.isactionpressed("left")) + int(Input.isactionpressed("right"))
var wall
direction = 1
func updatewalldirection():
var is
nearwallleft = checkisvalidwall(leftwallraycasts)
var isnearwallright = _checkisvalidwall(rightwallraycasts)

if is_near_wall_left && is_near_wall_right:
    wall_direction = move_direction
    wall_direction = -int(is_near_wall_left) + int(is_near_wall_right)

If anyone knows the problem let me know

Godot version Godot Mono version 3.5 stable
in Engine by (14 points)

1 Answer

0 votes

if you want to check your raycast
write if $RayCast2D.is_colliding :
print ("collide")

OR Remove raycasts and Replace it with
if isonwall and write if isonwall :
print ("isonwall")

by (59 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.