SideviewbodyComponent

Enables side-scrolling movement and jump, as well as collision with RectTile. Movement is affected by gravity. Used if the current tile map mode is SideViewRectTileMap.

# Properties

[{"index":"boolean ApplyClimbableRotation (Sync)","0":"When true, the character on the rotating or slanted ladder will be affected by the shape of the ladder. When false, the character will not be affected by the slant or rotation of the ladder."}]

[{"index":"float DownJumpSpeed (Sync)","0":"Controls the speed of the bounce back up when jumping down. The greater the value, the higher the bounce."}]

[{"index":"boolean EnableDownJump (Sync)","0":"Turns Jump Down on or off."}]

[{"index":"float JumpDrag (Sync)","0":"Controls the rate of the jump speed. The greater the value, the faster the fall."}]

[{"index":"float JumpSpeed (Sync)","0":"Controls the speed of the bounce when jumping. The greater the value, the faster the jump."}]

[{"index":"Vector2 MoveVelocity (HideFromInspector)","0":"Sets the movement speed. MovementComponent will be used to control the movement."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"RectTileInfo GetUnderfootTile()","0":"Checks the tile information currently being stepped on, and returns nil if there is no tile stepped on. Returns the left tile if it is above the boundary of two horizontally side-by-side tiles."}]

[{"index":"boolean IsOnGround()","0":"Checks the current contact with the ground."}]

[{"index":"void SetPosition(Vector2 position)","0":"Sets an Entity's position based on local coordinates."}]

[{"index":"void SetWorldPosition(Vector2 position)","0":"Sets an Entity's location to the world-based coordinates."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"RectTileCollisionBeginEvent","0":"This event occurs when touching the collidable tile."}]

[{"index":"RectTileCollisionEndEvent","0":"This event occurs when being freed from the collided tile."}]

[{"index":"RectTileEnterEvent","0":"This event occurs when entering a specific quadrangle tile."}]

[{"index":"RectTileLeaveEvent","0":"This event occurs when leaving a specific quadrangle tile."}]

# Examples

#### GetWallTile

This is an example of detecting the wall tile touching the side.
    
    
    @Component
    script WallTileTracker extends Component
        property table WallTile = {}
    
        @ExecSpace("ClientOnly")
        method table GetWallTile()
        return self.WallTile
        end
    
        @ExecSpace("ClientOnly")
        @EventSender("Self")
        handler HandleRectTileCollisionBeginEvent(RectTileCollisionBeginEvent event)
        ----------------- Native Emitter Info ------------------
        -- Emitter: KinematicbodyComponent
        -- Space: Server, Client
        --------------------------------------------------------
        -- Emitter: SideviewbodyComponent
        -- Space: Server, Client
        --------------------------------------------------------
    
        -- Parameters
        local Entity = event.Entity
        local Normal = event.Normal
        local Point = event.Point
        local TileInfo = event.TileInfo
        local TileMap = event.TileMap
        local TilePosition = event.TilePosition
        --------------------------------------------------------
    
        if Normal == Vector2.left or Normal == Vector2.right then
        	self.WallTile ={
        		info = TileInfo,
        		position = TilePosition:Clone(),
        		normal = Normal:Clone(),
        		tilemap = TileMap
        	}
        end 
        end
    
        @EventSender("Self")
        handler HandleRectTileCollisionEndEvent(RectTileCollisionEndEvent event)
        ----------------- Native Emitter Info ------------------
        -- Emitter: KinematicbodyComponent
        -- Space: Server, Client
        --------------------------------------------------------
        -- Emitter: SideviewbodyComponent
        -- Space: Server, Client
        --------------------------------------------------------
    
        -- Parameters
        local Entity = event.Entity
        local Normal = event.Normal
        local Point = event.Point
        local TileInfo = event.TileInfo
        local TileMap = event.TileMap
        local TilePosition = event.TilePosition
        --------------------------------------------------------
    
        local currWallTile = self.WallTile
    
        if currWallTile ~= nil and currWallTile.position == TilePosition then
        	self.WallTile = nil
        end
        end
    end
    

# SeeAlso

  * RectTileCollisionBeginEvent
  * RectTileCollisionEndEvent
  * Vector2
  * [Controlling Character Movement from SideViewRectTileMap](/docs?postId=759)
  * [Creating Maps with SideViewRectTile Mode](/docs?postId=758)