KinematicBody2DMoveAndSlideWithSnap Method |
Moves the body while keeping it attached to slopes. Similar to MoveAndSlide(Vector2, NullableVector2, Boolean, Int32, Single, Boolean).
As long as the snap vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting snap to (0, 0) or by using MoveAndSlide(Vector2, NullableVector2, Boolean, Int32, Single, Boolean) instead.
Namespace: Godot
public Vector2 MoveAndSlideWithSnap( Vector2 linearVelocity, Vector2 snap, Vector2? upDirection = null, bool stopOnSlope = false, int maxSlides = 4, float floorMaxAngle = 0.785398f, bool infiniteInertia = true )
[Missing <param name="linearVelocity"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <param name="snap"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <param name="stopOnSlope"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <param name="maxSlides"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <param name="floorMaxAngle"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <param name="infiniteInertia"/> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]
[Missing <returns> documentation for "M:Godot.KinematicBody2D.MoveAndSlideWithSnap(Godot.Vector2,Godot.Vector2,System.Nullable{Godot.Vector2},System.Boolean,System.Int32,System.Single,System.Boolean)"]