Although wild camping is largely permitted in Scotland thanks to the Scottish Outdoor Access Code, these rights and rules do not apply to motor vehicles, and different restrictions apply when travelling in a campervan.
If you wish to stay in an area, permission must first be obtained from the landowner. In addition, the Road Traffic Act 1988 states that you may only drive a vehicle off-road for the purpose of parking within 15 yards of a public road.
There are, however, areas throughout Scotland designated for motorhomes, and certain communities may be more accommodating than others. Check with a local information centre to find out if any local restrictions apply or if there are areas nearby where you can park up for a night.