The fence sort of goes in towards the castle.
How to get on the roof in super mario 64.
Turn your back to the fence.
You will also need 150 stars as opposed to the 120 in the nintendo 64 game for the cannon to open so that you can get to the top of the roof of the castle.
Carry out a triple jump with the third jump taking place near the green wall to the right of the castle.
Hang onto the roof and climb up to get to yoshi.
How to get to the roof 1.
A small tutorial on getting on top of the castle without collecting 120 stars.
From here either crawl up the slippery slope towards the centre of the roof or long jump over it crawling is probably safer.
From the starting area as luigi run left to where there is a little kink in the fence.
It lasts until the console is turned off.
A quick glance at a few game guides shows they all seem to give the following approximate advice.
This glitch only works in the american and european versions.
When jumping mario disappears for a second.
After killing the big boo check left and right and you should see small flat areas above the windows long jump to them.
Note that if you are playing super mario 64 ds you will be unable to meet yoshi as he is playable in the game.