Do you have any code?? Id guess your not using the function correctly
The function I posted works fine no matter where the parent sprite is or how its rotated....
Maybe try this....
// Project: SpriteRelativeMovement
// Created: 2018-07-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "SpriteRelativeMovement" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
spr1 = CreateSprite(0)
SetSpriteColor(spr1,255,255,0,255)
SetSpriteSize(spr1,200,200)
spr2 = CreateSprite(0)
SetSpriteColor(spr2,0,0,255,255)
SetSpriteSize(spr2,20,20)
do
// Spin the parent sprite
inc angle#,GetFrameTime()*180
if angle#>360 then angle# =0
// Rotate and move the parent sprite
SetSpriteAngle(spr1,angle#)
SetSpritePositionByOffset(spr1,GetRawMouseX(),GetRawMouseY())
// Keep the second sprite with its parent
SetSpritePositionRelative(spr2, -80,-80,spr1)
Print( ScreenFPS() )
Sync()
loop
function SetSpritePositionRelative(spr as integer, x as float, y as float, parent as integer)
// First copy the rotation angle
SetSpriteAngle(spr,GetSpriteAngle(parent))
// set sprite position
SetSpritePositionByOffset(spr,GetWorldXFromSprite( parent, x, y ),GetWorldYFromSprite( parent, x, y ))
endfunction